Skip to content

Instantly share code, notes, and snippets.

View srgvg's full-sized avatar
👓
ENOSTATUS

Serge van Ginderachter srgvg

👓
ENOSTATUS
View GitHub Profile
@srgvg
srgvg / gist:9507057
Created March 12, 2014 13:37
Example playbook with roles for ansible bug "Tags on tasks in dependent roles are not honoured"
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
host1 ansible_ssh_host=host1.domain.example
host2 ansible_ssh_host=host2.domain.example
@srgvg
srgvg / play.yml
Last active December 26, 2015 04:19
- hosts: localhost
gather_facts: false
connection: local
vars:
list1:
- 'a'
- 'b'
- 'c'
- 'd'
@srgvg
srgvg / output
Created September 9, 2013 21:49
tests for subelements lookup plugin
$ 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"}
@srgvg
srgvg / running with paramiko
Last active December 19, 2015 11:19
Testing ansible-rsyn forced update: $ git show HEAD commit 5d498052b808516b0411d4f3ce88adc9b842198b Author: Timothy Appnel <tim@appnel.com> Date: Mon Jun 10 19:21:36 2013 -0400 Introduced ansible-rsync to core
$ 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-
@srgvg
srgvg / hosts
Last active December 17, 2015 11:49
test inventory and commands showing a problem with variable precedence
# 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: