Skip to content

Instantly share code, notes, and snippets.

View jimi-c's full-sized avatar

James Cammarata jimi-c

View GitHub Profile
# roles/test1/vars/main.yml
---
test_rolevars: TEST1_ROLEVARS
# roles/test1/tasks/main.yml
---
- debug: msg="testvar = {{ test_rolevars }}"
# roles/test2/vars/main.yml
---
diff --git a/library/system/setup b/library/system/setup
index e39910f..d21bc71 100644
--- a/library/system/setup
+++ b/library/system/setup
@@ -1443,21 +1443,23 @@ class LinuxNetwork(Network):
netmask = socket.inet_ntoa(struct.pack('!L', netmask_bin))
network = socket.inet_ntoa(struct.pack('!L', address_bin & netmask_bin))
iface = words[-1]
- if iface != device:
- interfaces[iface] = {}
diff --git a/library/system/authorized_key b/library/system/authorized_key
index 54c9576..af4810d 100644
--- a/library/system/authorized_key
+++ b/library/system/authorized_key
@@ -210,29 +210,36 @@ def parsekey(raw_key):
'ssh-rsa',
]
+ options = None # connection options
+ key = None # encrypted key string
# ansible-playbook -vv 13712.yml
Using /etc/ansible/ansible.cfg as config file
1 plays in 13712.yml
PLAY ***************************************************************************
TASK [setup] *******************************************************************
ok: [localhost]
TASK [user] ********************************************************************
#!/usr/bin/python
"""
Cobbler external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
$ ansible -m uri -a "url=http://localhost:8888/whatever follow_redirects=yes" localhost
localhost | FAILED! => {
"changed": false,
"content": "",
"failed": true,
"location": "file:///etc/passwd",
"msg": "Status code was not [200]: HTTP Error 301: Found - Redirection to url 'file:///etc/passwd' is not allowed",
"redirected": false,
"status": 301,
"url": "http://localhost:8888/whatever"
commit 03c6b73e84ec1550c0be800d841af62df0ba1459 (HEAD -> master, upstream/master)
Author: James Cammarata <jimi@sngx.net>
Date: Thu Sep 27 00:38:18 2018 -0500
Adding haproxy load balancer for the mysql cluster
This proxy is available via a NodePort service, which can be accessed
from minikube with the `minikube service galera-haproxy-service --url`
command.
00:25:19.831 utils.py DEBUG task path: /home/jamesc/devel/menufaire_api/roles/menufaire-api/tasks/main.yml:2
00:25:19.831 utils.py ERROR [WARNING]: Failure using method (v2_playbook_on_task_start) in callback plugin (<ansible.plugins.callback./usr/lib/python3.6/site-
00:25:19.832 utils.py ERROR packages/ansible_bender-0.4.0-py3.6.egg/ansible_bender/callback_plugins/snapshoter.CallbackModule object at 0x7f935af45f50>): 'list' object has no attribute 'copy'
00:25:19.832 utils.py DEBUG Callback Exception:
00:25:19.832 utils.py DEBUG File "/data/devel/ansible/lib/ansible/executor/task_queue_manager.py", line 328, in send_callback
00:25:19.832 utils.py DEBUG method(*new_args, **kwargs)
00:25:19.832 utils.py DEBUG File "/usr/lib/python3.6/site-packages/ansible_bender-0.4.0-py3.6.egg/ansible_bender/callback_plugins/snapshoter.py", line 104, in v2_playbook_on_task_start
00:25:19.832 utils.py DEBUG return self._maybe_load_fr

Playbook:

- hosts: all
  gather_facts: no
  remote_user: root
  roles:
  - { role: test_become_r2, sudo_user: testing }
  tasks:
 - command: whoami