条件によって,roleを利用するかどうか分岐する.
host_vars/hoge
role_enabled: "yes"
playbook
- name: build role
include_role:
name: foo
when:
- foo_enabled == 'yes'
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
ところで,whenについている条件は and で繋がる.