k3s-io / k3s-ansible

Apache License 2.0
1.89k stars 780 forks source link

Error in 'ansible.posix.sysctl' due to Ansible migrations? #309

Closed sprijk closed 3 months ago

sprijk commented 3 months ago

Issuing ansible-playbook playbook/site.yml -i inventory.yml on a freshly installed ansible-core 2.16.4 using Python 3.10.12 on Ubuntu 22.04 gives:

ERROR! couldn't resolve module/action 'ansible.posix.sysctl'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/simon/Code/github/k3s-io/k3s-ansible/roles/prereq/tasks/main.yml': line 14, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Enable IPv4 forwarding
  ^ here

Could this be due to https://github.com/ansible/ansible/issues/68416#issuecomment-602867015 ?

sprijk commented 3 months ago

Fixed by doing: ansible-galaxy collection install ansible.posix

Now running into:

ERROR! couldn't resolve module/action 'community.general.ufw'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/simon/Code/github/k3s-io/k3s-ansible/roles/prereq/tasks/main.yml': line 43, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    - name: If ufw enabled, open api port
      ^ here

Probably another collection ;)

sprijk commented 3 months ago

Probably because I only installed ansible-core... pipx install ansible-core

sprijk commented 3 months ago

After install sshpass and adding the -kK flag to input sudo password, all is fine!