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.yml:- hosts: localhost | |
play.yml: gather_facts: false | |
play.yml: roles: | |
play.yml: - a | |
play.yml: | |
a/meta/main.yml:--- | |
a/meta/main.yml:dependencies: | |
a/meta/main.yml: - ab | |
a/tasks/debug.yml:--- | |
a/tasks/debug.yml:# tasks file for a |
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
host1 ansible_ssh_host=host1.domain.example | |
host2 ansible_ssh_host=host2.domain.example |
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: | |
list1: | |
- 'a' | |
- 'b' | |
- 'c' | |
- 'd' |
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
$ ansible-playbook play.yml -v | |
Monday 09 September 2013 23:40:57 +0200 | |
PLAY [localhost] ************************************************************** | |
Monday 09 September 2013 23:40:57 +0200 | |
TASK: [list] ****************************************************************** | |
Monday 09 September 2013 23:40:57 +0200 | |
ok: [localhost] => (item=({'name': 'foo', 'desc': 'FooBar'}, 1)) => {"item": [{"desc": "FooBar", "name": "foo"}, 1], "msg": "foo(FooBar) gets key 1"} | |
ok: [localhost] => (item=({'name': 'foo', 'desc': 'FooBar'}, 2)) => {"item": [{"desc": "FooBar", "name": "foo"}, 2], "msg": "foo(FooBar) gets key 2"} |
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
$ ansible-playbook -i antares.ginsys.net, synchtest.yml -vvv | |
PLAY [antares.ginsys.net] ***************************************************** | |
TASK: [synchronize src=./testfile dest=/tmp/ verbosity=1] ********************* | |
<antares.ginsys.net> ESTABLISH CONNECTION FOR USER: serge on PORT 22 TO antares.ginsys.net | |
<antares.ginsys.net> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1373268900.99-235780032268628 && chmod a+rx $HOME/.ansible/tmp/ansible-1373268900.99-235780032268628 && echo $HOME/.ansible/tmp/ansible-1373268900.99-235780032268628' | |
<antares.ginsys.net> PUT /tmp/tmpPW0obV TO /home/serge/.ansible/tmp/ansible-1373268900.99-235780032268628/synchronize | |
<antares.ginsys.net> EXEC /bin/sh -c '/usr/bin/python /home/serge/.ansible/tmp/ansible-1373268900.99-235780032268628/synchronize; rm -rf /home/serge/.ansible/tmp/ansible-1373268900.99-235780032268628/ >/dev/null 2>&1' | |
failed: [antares.ginsys.net] => {"cmd": "rsync --archive --delay-updates --compress -v --temp-dir /home/serge/.ansible/tmp/ansible- |
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
# app1 var=app1 app2 var=app2 | |
# / \ / \ | |
# app1-dev app1-prod app2-dev app2-prod var=app{1,2}-{dev,prod} (set to respective groupname) | |
# / \ / \ | |
# app1-dev-node app1-prod-node app2-dev-node app2-prod-node ${group}-node is the single member of $group | |
# | |
# each node ${group}-node should get as value for $var -> ${group} | |
# being the value of its respective group name ${group} | |
# test command: |
NewerOlder