simeononsecurity / ansible_linux_update

This Ansible role automates Linux security patching by applying updates to supported Linux distributions. It handles various package managers such as apt, dnf, yum, and apk to ensure that Linux systems are kept up to date with the latest security patches.
https://simeononsecurity.com/guides/automate-linux-patching-and-updates-with-ansible/
MIT License
5 stars 2 forks source link

ERROR! 'platforms' is not a valid attribute for a RoleMetadata #1

Closed n00bsi closed 2 months ago

n00bsi commented 4 months ago

Hello,

update_linux.yaml

- name: Apply Linux updates
  hosts: servers
  become: no

  roles:
    - linux_update

hosts

[servers]
ans02
ans03
ans04
ans05

ansible-playbook -i ~/ansible/hosts update_linux.yaml --syntax-check

ERROR! 'platforms' is not a valid attribute for a RoleMetadata

The error appears to be in '/root/ansible/playbooks/roles/linux_update/meta/main.yaml': line 2, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
galaxy_info:
^ here

What did I wrong ?

Using Almalinux 9.3 + ansible [core 2.14.14]

did Install by: ansible-galaxy role install simeononsecurity.linux_update

mkdir ansible
cd ansible
mkdir playbooks
cd playbooks
cp -r ~/.ansible/roles/ .
cd roles
ln -s simeononsecurity.linux_update linux_update
cd ~/ansible/playbooks

ansible-playbook -i hosts update_linux.yaml
simeononsecurity commented 4 months ago

I've not run this on 2.14.x yet. Possibly just a meta information syntax change. I'll check

simeononsecurity commented 4 months ago

According to https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#using-meta-main-yml it is correct However according to https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html it isn't I found that it was depreciated in https://github.com/ansible/ansible/issues/82453

simeononsecurity commented 4 months ago

I submitted an mr to update the documentation I based my meta on. https://github.com/ansible/ansible-documentation/pull/1458

simeononsecurity commented 4 months ago

@n00bsi please pull latest and try again.