Technotes

Technotes for future me

Ansible fail if condition fails

Ansible fail if condition fails

pre_tasks:
  - name: Fail if OS is not Centos
    fail:
      msg: "The playbook only supports Centos"
    when: ansible_distribution != 'CentOS'
Last updated on 31 Jan 2021
Published on 11 Dec 2019
Edit on GitHub