Hi,
I’m working on the Ansible httpd challenge and the playbook completes successfully on all three app servers:
stapp01 : ok=7 changed=6 unreachable=0 failed=0
stapp02 : ok=7 changed=6 unreachable=0 failed=0
stapp03 : ok=7 changed=6 unreachable=0 failed=0
My playbook contains:
---
- name: Setup Apache web server
hosts: all
become: true
tasks:
- name: Install httpd
ansible.builtin.package:
name: httpd
state: present
- name: Ensure httpd is running
ansible.builtin.service:
name: httpd
state: started
enabled: true
- name: Create index.html
ansible.builtin.copy:
dest: /var/www/html/index.html
content: "This is a Nautilus sample file, created using Ansible!\n"
- name: Add welcome message at the top
ansible.builtin.lineinfile:
path: /var/www/html/index.html
line: "Welcome to xFusionCorp Industries!"
insertbefore: BOF
- name: Set ownership of index.html
ansible.builtin.file:
path: /var/www/html/index.html
owner: apache
group: apache
- name: Set permissions on index.html
ansible.builtin.file:
path: /var/www/html/index.html
mode: '0755'
However, the challenge validator reports:
file '/var/www/html/index.html' having incorrect permissions on stapp01
I checked the file directly on stapp01:
$ stat -c '%a %U %G' /var/www/html/index.html
755 apache apache
The file contents are also correct:
$ cat /var/www/html/index.html
Welcome to xFusionCorp Industries!
This is a Nautilus sample file, created using Ansible!
So I’m confused why the validator reports incorrect permissions.
Is there something I’m missing about how the validator checks the permissions, or is there another detail I should verify?