ansible-practice/apache-when-handler.yml
2023-11-08 14:58:46 +00:00

23 lines
558 B
YAML

---
- name: "Apache installation"
hosts: 1-1.practice-k8s.cloud
force_handlers: yes
tasks:
- name: "Apache configuration"
template:
src: "inventory.conf.j2"
dest: "/etc/httpd/conf.d/inventory.conf"
owner: "apache"
group: "apache"
notify: [ "Restart apache service" ]
- name: copy nothing - intended to fail
copy:
src: /tmp/nothing
dest: /var/www/html/nothing.html
handlers:
- name: "Restart apache service"
service:
name: "httpd"
state: "restarted"