Last active
July 21, 2017 16:54
-
-
Save lordmuffin/c73804336593f872700ebbe07c843d08 to your computer and use it in GitHub Desktop.
Example of nested playbooks and different ip?
This file contains 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: this is a play at the top level of a file | |
hosts: pre-ip | |
remote_user: root | |
tasks: | |
- name: say hi | |
tags: foo | |
shell: echo "hi..." |
This file contains 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: this is a play at the top level of a file | |
hosts: post-ip | |
remote_user: root | |
tasks: | |
- name: say hi | |
tags: foo | |
shell: echo "hi..." |
This file contains 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
[pre-ip] | |
hostname1 ansible_host=192.0.2.50 | |
[post-ip] | |
hostname2 ansible_host=192.0.2.51 |
This file contains 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: this is a play at the top level of a file | |
hosts: pre-ip | |
remote_user: root | |
tasks: | |
- name: say hi | |
tags: foo | |
shell: echo "hi..." | |
# and this is how we include another playbook, be careful and | |
# don't recurse infinitely or anything. Note you can't use | |
# any variables in the include path here. | |
- include: hostname1.yml | |
- include: hostname2.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment