Last active
March 13, 2018 21:03
-
-
Save miticojo/2fc624b57bbe599fb9743b1b3d4000a5 to your computer and use it in GitHub Desktop.
Save variable though runnings
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 | |
| vars: | |
| my_variable_collection: | |
| colore: rosso | |
| occhi: azzurri | |
| segno: ariete | |
| tasks: | |
| - name: save all variables into a yaml file | |
| copy: | |
| content: "{{my_variable_collection|to_nice_yaml}}" | |
| dest: ./vars/final-vars.yml | |
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 | |
| tasks: | |
| - name: load variable file | |
| include_vars: | |
| dir: vars | |
| files_matching: final-vars.yml | |
| name: my_variable_collection | |
| - name: print out variable collection loaded | |
| debug: msg="{{my_variable_collection}}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment