Hi !
I’m having the following error in kk engineer: - it seems like you haven’t created the symbolic link to ‘/var/www/html’ properly on stapp01
But I mostly think I made it. This is my yml file:
---
- name: file creation
hosts: all
become: yes
tasks:
- name: firstFile
ansible.builtin.file:
path: /opt/devops/blog.txt
state: touch
owner: tony
group: tony
when: inventory_hostname == 'stapp01'
- name: makeDir1
ansible.builtin.file:
path: /var/www/html
state: directory
owner: tony
group: tony
mode: "0777"
when: inventory_hostname == 'stapp01'
- name: firstSymLink
ansible.builtin.file:
src: /opt/devops/blog.txt
dest: /var/www/html/blog.txt
state: link
owner: tony
group: tony
when: inventory_hostname == 'stapp01'
- name: secondFile
ansible.builtin.file:
path: /opt/devops/story.txt
state: touch
owner: steve
group: steve
when: inventory_hostname == 'stapp02'
- name: makeDir2
ansible.builtin.file:
path: /var/www/html
state: directory
owner: steve
group: steve
mode: "0777"
when: inventory_hostname == 'stapp02'
- name: secondSymLink
ansible.builtin.file:
src: /opt/devops/story.txt
dest: /var/www/html/story.txt
state: link
owner: steve
group: steve
when: inventory_hostname == 'stapp02'
- name: thirdFile
ansible.builtin.file:
path: /opt/devops/media.txt
state: touch
owner: banner
group: banner
when: inventory_hostname == 'stapp03'
- name: makeDir3
ansible.builtin.file:
path: /var/www/html
state: directory
owner: banner
group: banner
mode: "0777"
when: inventory_hostname == 'stapp03'
- name: thirdSymLink
ansible.builtin.file:
src: /opt/devops/media.txt
dest: /var/www/html/media.txt
state: link
owner: banner
group: banner
when: inventory_hostname == 'stapp03'
I’m able to create the folders and make the symbolic links. But by some unknown reason the lab fails with the previous reason. Can you explain what is the issue ? I think the lab doesn’t explain it well enough to be honest.
The 0777 permissions are because of being trying with different modes before, but I think the permissions of the file are not the issue.
Thanks in advance!
