Created
October 10, 2018 13:31
-
-
Save juliedavila/54d04358222a9c3486f1d2f400878567 to your computer and use it in GitHub Desktop.
Example Provision & Target
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: localhost | |
| connection: local | |
| tasks: | |
| - name: provision some shit | |
| whatever_module: | |
| ...args | |
| register: new_hosts | |
| - name: add hosts to in-memory inventory | |
| add_host: | |
| ## you can literally add any var value here and it will get translated as a host var | |
| hostname: "{{ new_hosts['something_resolvable'] }}" | |
| ansible_port: "{{ whatever_port }}" | |
| groups: | |
| - new_hosts | |
| - hosts: new_hosts | |
| tasks: | |
| ...do stuff | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment