Skip to content

Instantly share code, notes, and snippets.

View bdunbar's full-sized avatar

Brian Dunbar bdunbar

  • Nashville, TN
View GitHub Profile
Verifying that +bdunbar is my blockchain ID. https://onename.com/bdunbar
@bdunbar
bdunbar / gist:82f55ed4f1de76cd3d6e
Created October 24, 2014 20:42
playbook and failure to understand a thing on Friday
0. I want a playbook to execute an include if a value is True but to execute other includes if value is False.
1. This works
role\sftp\tasks\main.yml
- { include: configure.yml, tags: ['configure'] }
- { include: cic_users.yml, tags: ['cic_users'] }
2. But what I want to do is add a conditional. So that if variable foo is true it executes an include but the others do not execute.
http://www.microsoft.com/Downloads/details.aspx?familyid=6E1EC93D‐BDBD‐4983‐92F7‐
479E088570AD&displaylang=en
@bdunbar
bdunbar / gist:6b60d8a14e5ef2af8ebe
Created May 28, 2014 16:21
Password creation and not getting it
A thing I'm not getting.
# user.yml
- name: Register a password
shell: mkpasswd -s 0
register: password
when: ansible_os_family == "Debian"
- name: Create External User
user:
The Big Question. Run this playbook many times. Why is output, always, from one item 'changed' and one 'ok'?
# tasks/external_user_multi.yml
(snip)
- name: Maintain External Multi root user
user:
name: '{{ item.name }}'
group: '{{ item.name }}'
@bdunbar
bdunbar / ansible_cron_vvv
Created May 14, 2014 02:44
ansible cron error with -vvv
<10.0.1.136> EXEC ['ssh', '-C', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ubuntu/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'IdentityFile=aws/devops.pem', '-o', 'KbdInteractiveAuthentication=no', '-o', 'Pr
eferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.136', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1400035322.39-239409596769977 && chmod a+rx $HOME/.ansible/tmp/ansibl
e-tmp-1400035322.39-239409596769977 && echo $HOME/.ansible/tmp/ansible-tmp-1400035322.39-239409596769977'"]
PLAY [nfs_server_2] ***********************************************************
GATHERING FACTS ***************************************************************
ok: [aws-dr-nfs-2]
TASK: [nfs-server-2 | maintain nfs packages] **********************************
ok: [aws-dr-nfs-2] => (item=rpcbind,nfs-kernel-server,nfs-common,mdadm,xfsprogs,lvm2)
TASK: [nfs-server-2 | ebsx logical volume group management experimental] ******
failed: [aws-dr-nfs-2] => {"failed": true, "item": "", "parsed": false}