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
$ ansible-playbook play.yml | |
PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************** | |
TASK [debug] ******************************************************************************************************************************************************************************************************************************************************************* | |
ok: [localhost] => { | |
"msg": "[{\"foo\": \"bar\", \"abc\": \"xyz\"}, {\"foo\": 123, \"abc\": 456}]" | |
} | |
TASK [command] ***************************************************************************************************************************************************************************************************************************************************************** |
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
[inventory] | |
enable_plugins = ini, constructed |
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
TASK [Gathering Facts] ********************************************************************************************************************************************************************************************************************************************************* | |
ok: [localhost] | |
TASK [debug] ******************************************************************************************************************************************************************************************************************************************************************* | |
ok: [localhost] => { | |
"ansible_memtotal_mb": 16384 | |
} | |
TASK [command] ***************************************************************************************************************************************************************************************************************************************************************** | |
changed: [localhost] |
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
--- | |
# vars/foobar.yml | |
foobar_var: bob |
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
[defaults] | |
filter_plugins = plugins/filter | |
test_plugins = plugins/test |
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
# This one works with the include_/import_ interestingly | |
--- | |
- hosts: localhost | |
gather_facts: False | |
connection: local | |
vars: | |
rolename: test2 | |
roles: | |
- test1 |
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
PLAY [localhost] ********************************************************************************************************************** | |
TASK [assert] ************************************************************************************************************************* | |
ok: [localhost] => (item=\') => { | |
"changed": false, | |
"item": "\\'", | |
"msg": "All assertions passed" | |
} | |
ok: [localhost] => (item=\") => { | |
"changed": false, |
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
#jinja2:trim_blocks: True, lstrip_blocks: True | |
targets: | |
{% for privnet in all_private_subnets %} | |
- subnet_id: "{{ privnet }}" | |
security_groups: [ "{{ sg.group_id }}" ] | |
{% endfor %} | |
{% for pubnet in all_public_subnets %} | |
- subnet_id: "{{ pubnet }}" | |
security_groups: [ "{{ sg.group_id }}" ] | |
{% endfor %} |
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
# templates/mail_body.j2 | |
{% for host in play_hosts %} | |
The {{ host }} says {{ hostvars[host]['result']['stdout'] }} | |
{% endfor %} |
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
--- | |
- hosts: localhost | |
connection: local | |
gather_facts: False | |
vars: | |
myvar: | |
- name: qwe | |
att1: 1 | |
att2: user_1 | |
- name: asd |