Open
Description
Hi @alivx ,
I am facing a issue during remediation step where in I am getting the below error in step 1.7.1 Ensure message of the day is configured properly. I am not able to identify where I need to configure inventory_dir and custom_motd_file_path.
> 1.7.4 Ensure permissions on /etc/motd are configured] *************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: ['{{ custom_motd_file_path }}', 'files/templates/motd.j2']: {{ inventory_dir }}/custom_templates/motd_custom.txt: '**inventory_di**r**' is undefined**\n\nThe error appears to be in '/home/anupama/CIS-Ubuntu-20.04-Ansible/tasks/section_1_Initial_Setup.yaml': line 960, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - name: \"1.7.1 Ensure message of the day is configured properly\\n\n ^ here\nThis one looks easy to fix. It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote. For instance:\n\n when: \"ok\" in result.stdout\n\nCould be written as:\n\n when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n when: \"'ok' in result.stdout\"\n"}
The folder structure is as advised on github
-run.yaml
-CIS-Ubuntu-20.04-Ansible
configuration of run.yaml
- name: Harden Server
hosts: localhost
become: yes
remote_user: root
gather_facts: yes
roles:
- CIS-Ubuntu-20.04-Ansible
Thank you!
Metadata
Metadata
Assignees
Labels
No labels