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 / 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:
@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 / 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 / play.yml
Last active December 26, 2015 04:19
- hosts: localhost
gather_facts: false
connection: local
vars:
list1:
- 'a'
- 'b'
- 'c'
- 'd'
host1 ansible_ssh_host=host1.domain.example
host2 ansible_ssh_host=host2.domain.example
@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
@srgvg
srgvg / keybase.md
Last active March 17, 2018 17:33
keybase.md

Keybase proof

I hereby claim:

  • I am srgvg on github.
  • I am svg (https://keybase.io/svg) on keybase.
  • I have a public key ASAZ1BgJggVMr7x-pU7k51bg9-7JmQDQ2pEL-kQsyOa-Ogo

To claim this, I am signing this object:

@srgvg
srgvg / logging.yml
Created August 14, 2014 15:24
Example playbook for ansible issue #8617
- hosts: localhost
gather_facts: false
vars:
myvar: test
tasks:
- debug: msg={{myvar}}
@srgvg
srgvg / ansible.cfg
Last active August 29, 2015 14:06
ansible_issues_9085
[defaults]
hash_behaviour=merge
nocows=true
@srgvg
srgvg / util-bash-vuln-upgrade.yml
Last active August 16, 2019 13:35
deb playbook to fix CVE-2014-6271 bash remote execution vulnerability
---
- hosts: all
gather_facts: false
name: CVE-2014-6271 bash vulnerability fix
tasks:
- name: check bash fix
command: env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
register: command_result
changed_when: False