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 / 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 / custom.css
Last active December 2, 2018 01:30
Mastodon admin site settings with scouting colors
@import url('https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab');
body { font-family: 'Roboto', sans-serif }
.drawer__header, .column-header, .column-header__button, .column-header__back-button, .tabs-bar__link, .landing-page #mastodon-timeline .column-header { font-family: 'Roboto Slab', sans-serif; background: #003f87; color: #ffffff }
.tabs-bar__link.active { font-family: 'Roboto Slab', sans-serif; color: #e9e9e4; border-bottom: 2px solid #cd1126 }
.drawer__tab { font-family: 'Roboto Slab', sans-serif; color: #ffffff }
.button, .simple_form button, .simple_form .button, .simple_form .block-button { background-color: #ce1126 }
.flash-message.notice { background: #006b3f; color: #ffffff }
@deekayen
deekayen / substr.yml
Created March 21, 2018 17:45
Ansible variable substring from regex_replace
---
# RUN: ansible-playbook -i localhost, substr.yml
- hosts: localhost
vars:
stuff: deekayen@WINDOMAIN.COM
ansible_user: deekayen
tasks: