Hello,
In the Ansible level 4:“Ansible Setup Httpd and PHP”,
I pretty much made everything,the playbook was developed according to the tasks in hand,the execution of it went pretty well,i even checked the modifications on App server 2 (stapp02) and all the changes are done with success,hoever,the check Button for validation is failing and dont know why!
This is my Playbook:
- name: Do some shit on app servre 2
become: true
hosts: stapp02
tasks:-
name: Install httpd and php on app server 2
yum:
name: ‘{{ item }}’
state: latest
loop:- httpd
- php
-
name: Create a new dir on app server 2 /var/www/html/myroot
file:
path: /var/www/html/myroot
state: directory -
name: Set the Document Root of apache to /var/www/html/myroot
shell: sed -i ‘s|DocumentRoot “/var/www/html”|DocumentRoot “/var/www/html/myroot”|g’ /etc/httpd/conf/httpd.conf -
name: Copy a template to the newly created dir /var/www/html/myroot on app server 2
copy:
src: ~/playbooks/templates/phpinfo.php.j2
dest: /var/www/html/myroot/phpinfo.php.j2
owner: apache
group: apache -
name: Make sure httpd server is up and running and maybe enabled
service:
name: httpd
state: started
enabled: yes
it would be great to tell me what went wrong,thank you all!
-