Created
February 10, 2019 04:43
-
-
Save ciiqr/debba3bb269997507cba718f79617bc9 to your computer and use it in GitHub Desktop.
Ansible: Optional role include
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Check for optional role | |
stat: | |
path: '{{ item }}/optional' | |
register: role_exists | |
loop: "{{ lookup('config', 'DEFAULT_ROLES_PATH') }}" | |
- include_role: | |
name: optional | |
when: true in role_exists.results | map(attribute='stat.exists') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment