Skip to content

Instantly share code, notes, and snippets.

View mrlesmithjr's full-sized avatar

Larry Smith Jr. mrlesmithjr

View GitHub Profile
---
- hosts: localhost
connection: local
gather_facts: false
become: false
vars:
csvfile: "{{ lookup('file', 'hosts.csv') }}"
tasks:
- name: Parse CSV To YAML
template:
#! /usr/bin/env python
# Used for randomly generating hostnames, ips, and mac addresses
# for testing purposes.
#
__author__ = "Larry Smith Jr."
__email___ = "mrlesmithjr@gmail.com"
__maintainer__ = "Larry Smith Jr."
__status__ = "Development"
# http://everythingshouldbevirtual.com
# @mrlesmithjr
---
- hosts: all
become: false
remote_user: remote
vars:
user: 'remote'
tasks:
- name: scan and register
command: "ssh-keyscan {{ item }}"
register: "host_keys"
#!/usr/bin/env bash
# Allows to easily spin up a Docker Swarm Mode (1.12+) Portainer
# http://portainer.io/
#
# Larry Smith Jr.
# @mrlesmithjr
# http://everythingshouldbevirtual.com
# Turn on verbose execution
---
- hosts: all
become: true
vars:
tasks:
- name: Capture /etc/shadow
shell: "grep ^root{{ ':' }}[*!]{{ ':' }} /etc/shadow"
register: etc_shadow
- debug: var=etc_shadow
#!/usr/bin/env bash
# Allows to easily spin up an ELK stack running in Docker Swarm Mode (1.12+)
# Larry Smith Jr.
# @mrlesmithjr
# http://everythingshouldbevirtual.com
# Turn on verbose execution
set -x
### Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
### Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string example.org
d-i netcfg/wireless_wep string
# D-I config version 2.0
path ubuntu-installer/amd64/boot-screens
#include ubuntu-installer/amd64/boot-screens/menu.cfg
default ubuntu-installer/amd64/boot-screens/vesamenu.c32
prompt 0
timeout 300
default vesamenu.c32
label Ubuntu 16.04.2 (Pre-Seed)
menu label ^Install Ubuntu 16.04.2 (Pre-Seed)
kernel images/Ubuntu/16.04.2/install/netboot/ubuntu-installer/amd64/linux

Repo Info

This repo is for all home projects.

Preparing Repo

If not using git submodules:

---
- hosts: kvm_hosts
become: true
vars:
roles:
tasks:
- name: Capturing VM(s)
virt:
command: "list_vms"
register: "kvm_vms"