Created
December 6, 2017 11:20
-
-
Save halberom/2947e032ca853247e783c71bede37cad to your computer and use it in GitHub Desktop.
ansible - example adding item to list using set_fact
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
PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************** | |
TASK [set_fact] **************************************************************************************************************************************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [debug] ******************************************************************************************************************************************************************************************************************************************************************* | |
ok: [localhost] => { | |
"test_matrix_configs": [ | |
"tlsproxy", | |
"neutron" | |
] | |
} | |
PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************* | |
localhost : ok=2 changed=0 unreachable=0 failed=0 |
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 | |
gather_facts: False | |
connection: local | |
vars: | |
test_matrix_configs: ['tlsproxy'] | |
tasks: | |
- set_fact: | |
test_matrix_configs: "{{ test_matrix_configs + [ 'neutron' ] }}" | |
- debug: | |
var: test_matrix_configs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment