Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Typing...

Dag Wieers dagwieers

⌨️
Typing...
View GitHub Profile
View gist:24bd4cee971dea9aa2b3e839613fb623
ignored_keys = ('hash', 'timestamp')
def filter_items(d):
''' Filter out keys when returning items() '''
l = []
# Ensure we return sorted tuples
for k, v in sorted(d.items()):
if k not in ignored_keys:
l.append((k, v))
return l
View gist:5befad50fd0c17a43910a4ce07e178b3
19260 1538698222.91159: no more pending results, returning what we have
19260 1538698222.91179: results queue empty
19260 1538698222.91194: checking for any_errors_fatal
19260 1538698222.91211: done checking for any_errors_fatal
19260 1538698222.91224: checking for max_fail_percentage
19260 1538698222.91237: done checking for max_fail_percentage
19260 1538698222.91250: checking to see if all hosts have failed and the running result is not ok
19260 1538698222.91263: done checking to see if all hosts have failed
19260 1538698222.91275: getting the remaining hosts for this loop
19260 1538698222.91297: done getting the remaining hosts for this loop
View gist:96708bc3d5d04fbcd6c25e9bfee4da53
from voluptuous import Schema, Any, Required
schema = Schema([
Any(
{
Required('module'): str,
'description': str,
},
{
Required('ref'): str,
View gist:5164c17f97a06462d1bacc66bac669ec
- hosts: localhost
gather_facts: no
tasks:
- name: Blah
aci_interface_policy_leaf_profile:
host: '{{ aci_hostname }}'
username: '{{ aci_username }}'
password: '{{ aci_password }}'
validate_certs: '{{ aci_validate_certs | default(false) }}'
use_ssl: '{{ aci_use_ssl | default(true) }}'
View gist:c9c57bc550b73626ae401a0b71b72e22
[dag@moria ansible.git]$ test/runner/ansible-test integration wakeonlan --tox --python 2.7 -vvv>>> Metadata: metadata-iVbhQs.json
{'cloud_config': {}, 'changes': {}}
Run command: tox -c test/runner/tox.ini -e py27 -- /home/dag/home-made/ansible.git/test/runner/test.py integration wakeonlan --python 2.7 -vvv --metadata metadata-iVbhQs.json --color yes --requirements
Working directory: /home/dag/home-made/ansible.git
Program found: /usr/bin/tox
HOME=/home/dag
LC_ALL=en_US.UTF-8
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/anvers/default/bin:/home/dag/.local/bin:/home/dag/bin
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
py27 installed: appdirs==1.4.3,asn1crypto==0.22.0,bcrypt==3.1.3,cffi==1.10.0,coverage==4.4.1,cryptography==1.9,enum34==1.1.6,idna==2.5,ipaddress==1.0.18,Jinja2==2.9.6,junit-xml==1.7,MarkupSafe==1.0,packaging==16.8,paramiko==2.2.1,pyasn1==0.2.3,pycparser==2.18,PyNaCl==1.1.2,pyparsing==2.2.0,PyYAML==3.12,six==1.10.0
@dagwieers
dagwieers / gist:d52dcfa41ed417352435cd783dbe0903
Created Jul 4, 2017
Using the same playbook with diff mode
View gist:d52dcfa41ed417352435cd783dbe0903
PLAY [computer61] ************************************************************************************************************************
TASK [win_regedit] ***********************************************************************************************************************
[HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
-"SMB1" = "dword:0"
+"SMB1" = "dword:4294967295"
changed: [computer61]
TASK [win_regedit] ***********************************************************************************************************************
ok: [computer61]
View gist:6e6f200074f17dea2457348a5e8b1d93
- hosts: computer61
gather_facts: no
tasks:
- win_regedit:
key: HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
value: SMB1
data: 0xffffffff
datatype: dword
state: present
@dagwieers
dagwieers / gist:5994177
Last active Mar 28, 2016
Testing ansible_connection=local
View gist:5994177
[dag@moria ~]$ cat hosts
localhost ansible_connection=local
[dag@moria ~]$ ansible -i hosts localhost -m ping
localhost | success >> {
"changed": false,
"ping": "pong"
}
[dag@moria ~]$ ansible -vv -i hosts localhost -m ping
<localhost> REMOTE_MODULE ping
You can’t perform that action at this time.