Skip to content

Instantly share code, notes, and snippets.

Avatar

Larry Smith Jr. mrlesmithjr

View GitHub Profile
View Postman-Tower-AWX.json
{
"info": {
"_postman_id": "0d319df0-e132-4187-82f7-5e42d4e5335d",
"name": "TOWER",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Tasks",
"request": {
@mrlesmithjr
mrlesmithjr / get_ip.py
Created Jul 28, 2019
Ansible IP request loops mockup
View get_ip.py
#!/usr/bin/python
from random import getrandbits
from ipaddress import IPv4Network, IPv4Address
from ansible.module_utils.basic import AnsibleModule
def main():
fields = {'subnet': {'required': True, 'type': 'str'}}
module = AnsibleModule(argument_spec=fields)
View flush_dns.py
#!/usr/bin/env python
# flush_dns.py
'''A handy script to flush dns cache for Linux/macOS/Windows.'''
import logging
from subprocess import Popen
from sys import platform
import psutil
View file_last_updated.yml
---
- hosts: localhost
gather_facts: true
connection: local
# user: ansible
# become: true
vars:
# Define path to file to check
# file_to_check: /etc/ansible/ansible.cfg
# file_to_check: $HOME/ansible.cfg
View gist:444002a3091b1f9597c796d706188bd1
### Keybase proof
I hereby claim:
* I am mrlesmithjr on github.
* I am mrlesmithjr (https://keybase.io/mrlesmithjr) on keybase.
* I have a public key ASDZkpNIa6LhHlP9uBTN7GG2FYQUIM0l0SCD5wtHGjw4ywo
To claim this, I am signing this object:
View gist:77e3fa8a3d50835b2c531ce52eb5c51e
#adduser --shell /bin/bash --gecos "" --disabled-password testuser1
useradd -s /bin/bash -m -G sudo testuser1
echo "testuser1:testpass" | chpasswd
View ubuntu-live.json
{
"variables": {
"boot_command_prefix": "",
"box_tag": "",
"compression_level": "6",
"iso_checksum": "",
"iso_checksum_type": "",
"iso_url": "",
"vagrant_cloud_token": "",
"vagrant_cloud_username": "",
@mrlesmithjr
mrlesmithjr / windows_runonce
Last active Mar 15, 2019
Windows runonce for Ansible
View windows_runonce
powershell.exe -Command "& {[Net.ServicePointManager]::SecurityProtocol = 'tls12'; Invoke-WebRequest -Uri https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile C:\Windows\Temp\ConfigureRemotingForAnsible.ps1}"
powershell.exe -ExecutionPolicy Unrestricted -File C:\Windows\Temp\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert -EnableCredSSP
View mappings.py
#!/usr/bin/env python
import json
VMS = {
'db01': {
'profile': 'Linux_DB',
'vm_size': 'medium'
},
'web01': {
'profile': 'Linux_Web',
View find_venv_dirs.py
#!/usr/bin/env python
import os
import shutil
for root, dirs, files in os.walk(os.getcwd()):
if 'venv' in dirs:
print('Found venv in {0}'.format(root))
folder = os.path.join(root, 'venv')
shutil.rmtree(folder)