ansible-role-cis
ansible-role-cis copied to clipboard
assert | Include distribution specific assertions: "Could not find or access './Debian-12/assert.yml' on the Ansible Controller.
Describe the bug
After installing all dependencies via requirements I ran the playbook below to test out what this role exactly does. It seems to be looking for a file specific to my os (Debian12) but can't find it.
I got following out
Playbook
requirements.yaml:
- robertdebock.bootstrap
- robertdebock.cron
- robertdebock.update
- robertdebock.cis
apply_cis_recommendations.yaml:
- name: Prepare
hosts: "{{ env }}"
become: yes
gather_facts: no
roles:
- role: robertdebock.bootstrap
- role: robertdebock.cron
- role: robertdebock.update
- name: Converge
hosts: "{{ env }}"
become: yes
gather_facts: yes
roles:
- role: robertdebock.cis
I tried it also with requirements.yml.
Output
ansible-playbook -i inventory/hosts.yaml common/system/apply_cis_recommendations.yaml -K -e env=testing
BECOME password:
PLAY [Prepare] ***********************************************************************************************************************************************************************************
TASK [robertdebock.bootstrap : Validating arguments against arg spec 'main' - Prepare a system to be managed by Ansible.] ************************************************************************
ok: [testing_master1]
ok: [testing_gateway1]
ok: [testing_volume1]
ok: [testing_volume2]
TASK [robertdebock.bootstrap : assert | Test bootstrap_wait_for_host] ****************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.bootstrap : assert | Test bootstrap_timeout] **********************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.bootstrap : assert | Test bootstrap_become] ***********************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.bootstrap : Wait for port to be available] ************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_volume1]
ok: [testing_master1]
ok: [testing_gateway1]
TASK [robertdebock.bootstrap : Test connection] **************************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_master1]
ok: [testing_volume1]
ok: [testing_gateway1]
TASK [robertdebock.bootstrap : Test sudo] ********************************************************************************************************************************************************
ok: [testing_gateway1]
ok: [testing_volume2]
ok: [testing_volume1]
ok: [testing_master1]
TASK [robertdebock.bootstrap : Gather ansible facts] *********************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_gateway1]
ok: [testing_master1]
ok: [testing_volume1]
TASK [robertdebock.bootstrap : Install bootstrap packages (package)] *****************************************************************************************************************************
ok: [testing_gateway1] => (item=python3)
ok: [testing_volume1] => (item=python3)
ok: [testing_volume2] => (item=python3)
ok: [testing_master1] => (item=python3)
ok: [testing_volume2] => (item=sudo)
ok: [testing_volume1] => (item=sudo)
ok: [testing_gateway1] => (item=sudo)
ok: [testing_master1] => (item=sudo)
ok: [testing_volume1] => (item=gnupg)
ok: [testing_volume2] => (item=gnupg)
ok: [testing_gateway1] => (item=gnupg)
ok: [testing_master1] => (item=gnupg)
ok: [testing_volume1] => (item=python3-apt)
ok: [testing_volume2] => (item=python3-apt)
ok: [testing_gateway1] => (item=python3-apt)
ok: [testing_master1] => (item=python3-apt)
TASK [robertdebock.cron : assert | Test cron_shell] **********************************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.cron : assert | Test cron_path] ***********************************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.cron : assert | Test cron_mailto] *********************************************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.cron : assert | Test cron_jobs] ***********************************************************************************************************************************************
skipping: [testing_master1]
TASK [robertdebock.cron : assert | Test item in cron_jobs] ***************************************************************************************************************************************
skipping: [testing_master1]
TASK [robertdebock.cron : assert | Test item.minute] *********************************************************************************************************************************************
skipping: [testing_master1]
TASK [robertdebock.cron : assert | Test item.hour] ***********************************************************************************************************************************************
skipping: [testing_master1]
TASK [robertdebock.cron : assert | Test item.weekday] ********************************************************************************************************************************************
skipping: [testing_master1]
TASK [robertdebock.cron : Install cron] **********************************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_volume1]
ok: [testing_gateway1]
ok: [testing_master1]
TASK [robertdebock.cron : Configure shell] *******************************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_gateway1]
ok: [testing_volume1]
ok: [testing_master1]
TASK [robertdebock.cron : Configure path] ********************************************************************************************************************************************************
ok: [testing_master1]
ok: [testing_gateway1]
ok: [testing_volume2]
ok: [testing_volume1]
TASK [robertdebock.cron : Configure mailto] ******************************************************************************************************************************************************
ok: [testing_gateway1]
ok: [testing_volume1]
ok: [testing_volume2]
ok: [testing_master1]
TASK [robertdebock.cron : Start and enable cron] *************************************************************************************************************************************************
ok: [testing_volume1]
ok: [testing_volume2]
ok: [testing_gateway1]
ok: [testing_master1]
TASK [robertdebock.cron : Schedule requested cron jobs] ******************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : assert | Test if update_autoremove is set correctly] *****************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.update : assert | Test if update_upgrade_command is set correctly] ************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.update : assert | Test if update_cache_valid_time is set correctly] ***********************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.update : assert | Test if update_reboot is set correctly] *********************************************************************************************************************
ok: [testing_master1 -> localhost]
TASK [robertdebock.update : Update cache (apk)] **************************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (apk)] *******************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (apt)] *******************************************************************************************************************************************
ok: [testing_volume2]
ok: [testing_volume1]
ok: [testing_gateway1]
ok: [testing_master1]
TASK [robertdebock.update : Apt autoremove (apt)] ************************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (dnf)] *******************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (pacman)] ****************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (yum/6)] *****************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (yum)] *******************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Install yum-utils] ***************************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
TASK [robertdebock.update : Update all software (zypper)] ****************************************************************************************************************************************
skipping: [testing_master1]
skipping: [testing_gateway1]
skipping: [testing_volume1]
skipping: [testing_volume2]
PLAY [Converge] **********************************************************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************************************
ok: [testing_volume1]
ok: [testing_gateway1]
ok: [testing_volume2]
ok: [testing_master1]
TASK [robertdebock.cis : assert | Include distribution specific assertions] **********************************************************************************************************************
fatal: [testing_master1 -> localhost]: FAILED! => {"reason": "Could not find or access '/home/tanguille/Documents/Software/Root/rootstrap/common/system/Debian-12/assert.yml' on the Ansible Controller."}
NO MORE HOSTS LEFT *******************************************************************************************************************************************************************************
PLAY RECAP ***************************************************************************************************************************************************************************************
testing_gateway1 : ok=13 changed=0 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
testing_master1 : ok=23 changed=0 unreachable=0 failed=1 skipped=15 rescued=0 ignored=0
testing_volume1 : ok=13 changed=0 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
testing_volume2 : ok=13 changed=0 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
Environment
- Control node OS: Fedora Linux 39
- Control node Ansible version: 2.16.2
- Managed node OS: Debian12 running in Proxmox VE 8.1