Created
September 28, 2017 08:52
-
-
Save justdoit0823/fe9254cf9039f0ad891b52ea45fa40e6 to your computer and use it in GitHub Desktop.
Manage multiple projects witnin one playbook in ansible.
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: "common task" | |
command: "{{item.cmd}}" | |
with_items: | |
- {cmd: "A", tag: ["projectA"]} | |
- {cmd: "B", tag: ["projectB"]} | |
when: item.tag | intersect(current_tag) | |
tags: | |
- projectA | |
- projectA-sub1 | |
- projectA-sub2 | |
- projectB | |
- projectB-sub1 | |
- projectB-sub2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment