snowdrop/k8s-infra

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

cmoulliard opened this issue · 2 comments

Issue

This command VM_NAME=k124-tekton; ansible-playbook ansible/playbook/hetzner/hetzner_vm_create_passwordstore.yml -e vm_name=${VM_NAME} -e k8s_type=masters -e k8s_version=124 -e salt_text=$(gpg --gen-random --armor 1 20) -e vm_image=fedora-37 -e server_type=cpx41

generates the following error on Hetzner

TASK [Install SELinux] ***************************************************************************************************************************************************************
Monday 22 May 2023  16:00:57 +0200 (0:00:01.941)       0:01:31.345 ************
ERROR! couldn't resolve module/action 'ansible.posix.selinux'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/Users/cmoullia/code/snowdrop/k8s-infra/ansible/roles/sec/selinux/tasks/main.yml': line 16, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: "Enable SELinux"
  ^ here

PLAY RECAP ***************************************************************************************************************************************************************************
k124-tekton                : ok=17   changed=8    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0
localhost                  : ok=50   changed=14   unreachable=0    failed=0    skipped=19   rescued=0    ignored=0

Monday 22 May 2023  16:00:57 +0200 (0:00:00.035)       0:01:31.381 ************
===============================================================================
passstore/ansible_inventory : Push changes to the pass git database ---------------------------------------------------------------------------------------------------------- 15.43s
Get user password from pass -------------------------------------------------------------------------------------------------------------------------------------------------- 13.85s
sec/firewalld : Install firewalld --------------------------------------------------------------------------------------------------------------------------------------------- 5.50s
sec/motd : Config | Install custom `/etc/motd` file --------------------------------------------------------------------------------------------------------------------------- 3.08s
sec/audit : Apply auditd configuration ---------------------------------------------------------------------------------------------------------------------------------------- 3.03s
sec/audit : Install audit required packages ----------------------------------------------------------------------------------------------------------------------------------- 2.65s
ping hosts -------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.49s
sec/firewalld : Enable and start firewalld ------------------------------------------------------------------------------------------------------------------------------------ 2.47s
Gathering Facts --------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.39s
passstore/ansible_inventory : Pull pass git database -------------------------------------------------------------------------------------------------------------------------- 2.31s
passstore/ansible_inventory : Pull pass git database -------------------------------------------------------------------------------------------------------------------------- 2.23s
passstore/ansible_inventory : Push changes to the pass git database ----------------------------------------------------------------------------------------------------------- 2.16s
Pull pass git database -------------------------------------------------------------------------------------------------------------------------------------------------------- 2.13s
passstore/ansible_inventory : Push changes to the pass git database ----------------------------------------------------------------------------------------------------------- 2.06s
sec/firewalld : firewalld - Manage firewall services -------------------------------------------------------------------------------------------------------------------------- 1.97s
sec/audit : Enable and start auditd ------------------------------------------------------------------------------------------------------------------------------------------- 1.94s
passstore/ansible_inventory : Pull pass git database -------------------------------------------------------------------------------------------------------------------------- 1.90s
Pull pass git database -------------------------------------------------------------------------------------------------------------------------------------------------------- 1.83s
sec/firewalld : Block black list ports ---------------------------------------------------------------------------------------------------------------------------------------- 1.80s
Push changes to the pass git database ----------------------------------------------------------------------------------------------------------------------------------------- 1.68s

@cmoulliard Could you check if you have the ansible.posix collection installed?

ansible-galaxy collection install ansible.posix
ansible-galaxy collection install ansible.posix
Process install dependency map
Starting collection install process
Installing 'ansible.posix:1.5.4' to '/Users/cmoullia/.ansible/collections/ansible_collections/ansible/posix'

Such a pre-red should be checked by the playbook ? @jacobdotcosta