Ansible execute a role with condition
Ansible execute a role with condition
---
# execute a role with condition
- hosts: http
user: "test"
become: yes
become_method: sudo
connection: ssh
roles:
- { role: http, when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'" }