Wednesday, 14 August 2019

Error handling in Ansible by Raj Gupta

In this case it will ignore the first task and run the second task

[ansible@ip-172-31-80-19 ~]$ cat playbook100.yml
-
  name: "this is our first playbook."
  hosts: all
  tasks:
    -
      name: 'first task'
      apt: name='apache2' state='present'
      ignore_errors: True
    -
      name: 'secound task'
      command: touch /tmp/strategy_task2.txt
[ansible@ip-172-31-80-19 ~]$

No comments:

Post a Comment