Skip to content

Instantly share code, notes, and snippets.

View jctanner's full-sized avatar

James Tanner jctanner

View GitHub Profile
diff --git a/lib/ansible/plugins/strategy/__init__.py b/lib/ansible/plugins/strategy/__init__.py
index 6a38edc..9b5f7b8 100644
--- a/lib/ansible/plugins/strategy/__init__.py
+++ b/lib/ansible/plugins/strategy/__init__.py
@@ -398,6 +398,8 @@ class StrategyBase:
cur_pass = 0
while True:
+ import q; q(cur_pass)
+ #import time; time.sleep(5)
#!/bin/bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
RESDIR=/tmp/ansible_data
[jtanner@jtw530 AP-SFDC_02367224]$ ANSIBLE_SCP_IF_SSH=False ansible el7host -vvvv -i inventory -m ping -e "ansible_python_interpreter=/usr/bin/python" | tee -a test.log
ansible 2.9.0.dev0
config file = /data/workspace.issues/AP-SFDC_02367224/ansible.cfg
configured module search path = [u'/home/jtanner/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /data/workspace.issues/AP-SFDC_02367224/ansible/lib/ansible
executable location = /data/workspace.issues/AP-SFDC_02367224/ansible/bin/ansible
python version = 2.7.15 (default, Oct 15 2018, 15:26:09) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]
Using /data/workspace.issues/AP-SFDC_02367224/ansible.cfg as config file
setting up inventory plugins
# make the n divisions for a=0 b=1 n=8
[jtanner@jtw530 ~]$ python -c 'import numpy as np; print([x*.125 for x in range(0,9)])'
[0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0]
# find f(x) for each division
[jtanner@jtw530 ~]$ python -c 'import numpy as np; print([np.exp(x*.125) for x in range(0,9)])'
[1.0, 1.1331484530668263, 1.2840254166877414, 1.4549914146182013, 1.6487212707001282, 1.8682459574322223, 2.117000016612675, 2.398875293967098, 2.718281828459045]
# add all the f(x) values
[jtanner@jtw530 ~]$ python -c 'import numpy as np; print(sum([np.exp(x*.125) for x in range(0,9)]))'
@jctanner
jctanner / testinfra.ansible_runner.py
Created February 1, 2019 14:42
testinfra ansible_runner port
# coding: utf-8
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/rc
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/status
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/job_events
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/job_events/b30e3982-ac94-4ca3-861c-fbbc97f3e9ef-partial.json
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/job_events/b014c44b-faa6-4d03-a727-f3e8ab54b913-partial.json
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/job_events/98eca250-5807-4f9e-a7bd-3e2718af58b5-partial.json
/tmp/tmpx5htffv_/artifacts/4a2749a7-25fa-4022-8716-b551576c7b03/stdout
/tmp/tmpx5htffv_/env
/tmp/tmpx5htffv_/env/envvars
#BEFORE
/tmp/awx_153_KFri35/facts/ios_3 2019-01-10 20:29:49.347664346 +0000
/tmp/awx_153_KFri35/facts/ios_3: ASCII text, with very long lines, with no line terminators
#AFTER
/tmp/awx_153_KFri35/facts/ios_3 2019-01-10 20:29:54.890671627 +0000
/tmp/awx_153_KFri35/facts/ios_3: ASCII text
@jctanner
jctanner / rhel_filters.py
Created December 19, 2018 00:40
rhel filters
[22/1139]
TASK [set_fact] ************************************************************************************************
task path: /home/jtanner/workspace/issues/AP-RHEL_FACT_FILTER/site.yml:6
ok: [el7host] => {
"ansible_facts": {
"device_by_pciid1": {
"virtio2": "eth0",
"virtio3": "eth1"
},
"device_by_pciid2": {
#!/usr/bin/env python
import os
import re
import subprocess
from pprint import pprint
def get_file_lines(fn):
@jctanner
jctanner / test_dumper.py
Created October 16, 2018 04:56
dumper reproducer
#!/usr/bin/env python
import datetime
import io
import json
import os
import shutil
import six
from ansibullbot._text_compat import to_bytes, to_text