error handling

 We have a playbook at ~/playbooks/httpd.yml to install httpd web server on all web nodes. The inventory file at ~/playbooks/inventory has these web nodes added. Update playbook so that if any task fails for any of the web nodes the playbook should exit for all hosts.



============



---

- name: Install httpd

  hosts: all

  any_errors_fatal: true

  gather_facts: no

  tasks:

    - name: Install httpd

      yum:

        name: httpd

        state: present


    - name: start service

      service:

        name: httpd

        state: started

Comments

Popular posts from this blog

exam 16

ansible 5

practical 3