Skip to content

Instantly share code, notes, and snippets.

View deekayen's full-sized avatar
🏡
Working from home

David Norman deekayen

🏡
Working from home
View GitHub Profile
@deekayen
deekayen / smtptest.py
Created December 12, 2019 18:15
Written by Chris Koning as a demo python script to bootstrap a test scenario for checking ports in Molecule for the outcome of an Ansible playbook.
#!/usr/bin/env python3
from smtplib import SMTP
import http.client
print("Testing good SMTP")
try:
goodSmtp = SMTP(host="cioxhealth-com.mail.protection.outlook.com",port=25,timeout=10)
response = goodSmtp.noop()
@deekayen
deekayen / sponsor.yml
Created December 10, 2019 04:49
Sample block to plug my sponsor page on GitHub for placement at the end of an Ansible role task list
---
- hosts: all
connection: local
tasks:
- debug:
msg:
- "****************************************"
- "| Sponsor deekayen to maintain this |"
@deekayen
deekayen / .gitignore
Last active November 28, 2019 03:27
Use Ansible to apply operating system routine maintenance and updates for CentOS and Red Hat servers. This example takes advantage of magic groups that are imported using AWS inventories in Ansible Tower for host filtering. Send extra-vars to limit the runtime by availability zone.
*.keytab
*.retry
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
@deekayen
deekayen / tagging_compliance.yml
Last active November 21, 2019 19:01
Query AWS to find instances and volumes without Name tags using an Ansible playbook. In Ansible Tower, use a null inventory along with an AWS cloud credential. Extend this with another task to stop instances with no Name tag.
---
- hosts: 127.0.0.1
connection: local
become: no
vars:
aws_region: us-east-1
tasks:
@deekayen
deekayen / update_git.sh
Created September 24, 2019 16:28
Update all the git repos in a directory with the latest pull of master
#!/bin/sh
find . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \;
@deekayen
deekayen / cowsay.yml
Last active September 20, 2019 20:54
Parse brew list for the version of currently installed cowsay.
---
- hosts: localhost
connection: local
tasks:
- name: Install cowsay.
homebrew:
name: cowsay
@deekayen
deekayen / buffalo.cow
Last active January 8, 2020 19:03
Buffalo animal for cowsay
##
## Buffalo
##
$the_cow = <<EOC;
$thoughts
$thoughts _.-````'-,_
_,.,_ ,-'` `'-.,_
/) ( '``-.
(( ) ) `\\
\\) (_/ )\\
@deekayen
deekayen / motd.txt
Created September 3, 2019 20:12
BSA logo in ASCII
.
.l.
'ONx.
,0MkMO'
;XMMlMMK,
;XMMM,MMMK,
'KMMMN'NMMMK'
....... .dMMMMK'KMMMMo. ......
,cd0XWMMWX0d:XMMMMKlkXMMMK;dOXWWWWXOo:,
lc;,'......':xNMMxllKdxMMMNx:'.....',;:ll
@deekayen
deekayen / .gitattributes
Created August 6, 2019 04:37
Print the vaulted AWS secrets stored in Ansible Tower
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
@deekayen
deekayen / resize_instance.yml
Created July 3, 2019 17:21
Resize EC2 instances using Ansible Tower.
---
- hosts: all
connection: local
gather_facts: no
pre_tasks:
- debug:
var: ansible_limit
verbosity: 1