Last active
February 10, 2019 21:33
-
-
Save ciiqr/70c4b82b5c368ab86113d36c7aa9eba3 to your computer and use it in GitHub Desktop.
Ansible: Conditional Roles
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
- hosts: all | |
gather_facts: no | |
roles: | |
# Platforms | |
- { role: linux, when: platform == 'linux' } | |
- { role: osx, when: platform == 'osx' } | |
- { role: windows, when: platform == 'windows' } | |
# OS | |
- { role: ubuntu, when: distribution == 'ubuntu' } | |
- { role: void, when: distribution == 'void' } | |
# Roles | |
- { role: base, when: "'base' in roles" } | |
- { role: ssh, when: "'ssh' in roles" } | |
- { role: gpg, when: "'gpg' in roles" } | |
- { role: frontend, when: "'frontend' in roles" } | |
- { role: sublime, when: "'sublime' in roles" } | |
- { role: quick-launch, when: "'quick-launch' in roles" } | |
- { role: development, when: "'development' in roles" } | |
- { role: hidpi, when: "'hidpi' in roles" } | |
# Machine | |
- { role: laptop-william, when: machine == 'laptop-william' } | |
- { role: desktop-william, when: machine == 'desktop-william' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment