Skip to content

Instantly share code, notes, and snippets.

View samdoran's full-sized avatar

Sam Doran samdoran

View GitHub Profile
@samdoran
samdoran / 1.json
Last active March 23, 2018 16:15
1Password Output Examples
{
"details" : {
"passwordHistory" : [
{
"value" : "XXXXXXXXXXXX",
"time" : 1384179071
},
{
"time" : 1384978053,
"value" : "XXXXXXXXXXXXXXXXXXXX"
---
- include_tasks: hello-world-1.yml
- include_tasks: hello-world-2.yml
- include_tasks: hello-world-4.yml
- include_tasks: hello-world-3.yml
- include_tasks: hello-world-8.yml
- include_tasks: hello-world-7.yml
- include_tasks: hello-world-6.yml
- include_tasks: hello-world-5.yml
- include_tasks: hello-world-9.yml
loop:
lookup: first_found
args:
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
- "{{ role_path }}/vars/default.yml"
loop:
lookup: subelements
@samdoran
samdoran / output.txt
Created February 7, 2018 14:55
failing unit test
----------------------------------------------- generated xml file: /Users/sdoran/Source/ansible/test/results/junit/python2.7-units.xml ------------------------------------------------
=============================================================================== short test summary info ================================================================================
FAIL test/units/modules/network/edgeos/test_edgeos_command.py::TestEdgeosCommandModule::test_edgeos_command_simple
======================================================================================= FAILURES =======================================================================================
__________________________________________________________________ TestEdgeosCommandModule.test_edgeos_command_simple __________________________________________________________________
self = <units.modules.network.edgeos.test_edgeos_command.TestEdgeosCommandModule testMethod=test_edgeos_command_simple>
def test_edgeos_command_simple(self):
@samdoran
samdoran / handlertest.yml
Last active December 23, 2021 00:00
Conditional tasks across plays
- name: Run role1
hosts: localhost
tasks:
- import_role:
name: role1
- name: Run role2
hosts: localhost
@samdoran
samdoran / issue-19305.yml
Last active November 17, 2017 16:23
Issue 19305
- name: Issue 19305 - Include role and variable issues
hosts: localhost
connection: local
become: no
gather_facts: no
tasks:
- name: Include some roles
include_role:
name: "{{ item }}"
@samdoran
samdoran / reproducer.sh
Created November 9, 2017 16:08
Static includes can't use default vars in a role
#!/bin/bash
mkdir -p ./roles/testrole/{defaults,tasks}
touch ./roles/testrole/{defaults,tasks}/main.yml
touch ./roles/testrole/tasks/{install,remove}.yml
cat > playbook-default-vars.yml << EOF
- hosts: localhost
roles:
- testrole
EOF

Keybase proof

I hereby claim:

  • I am samdoran on github.
  • I am sdoran (https://keybase.io/sdoran) on keybase.
  • I have a public key ASDLmVyCCKzKpmhfBGFxAFasgRuwLd-MpA5D7yYjMfGrXgo

To claim this, I am signing this object:

{
"register": "outputs",
"command": "{{kubespray_command}}",
"name": "run kubespray"
},
@samdoran
samdoran / template.j2
Created October 13, 2017 18:58
Ansible Template Testing Data
{{ register.results | map(attribute='changed') | list }}