This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PARAMS="" | |
while (( "$#" )); do | |
case "$1" in | |
-1|--flag-with-argument-1) | |
F_ARG_1=$2 | |
shift 2 | |
;; | |
-2|--flag-with-argument-2) | |
F_ARG_2=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ansible config see https://www.vagrantup.com/docs/provisioning/ansible_common.html#extra_vars | |
Vagrant.configure(2) do |config| | |
config.vm.define "machine-a" do |subconfig| | |
subconfig.vm.box = "generic/centos7" | |
subconfig.vm.hostname = "machine-a.local" | |
subconfig.vbguest.auto_update = false | |
subconfig.vm.network :private_network, ip: "192.168.199.101" | |
subconfig.vm.provider :virtualbox do |vb| | |
vb.memory = 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one | |
mkdir -p centos7_box | |
cd centos7_box | |
touch Vagrantfile | |
cat << EOF > Vagrantfile | |
Vagrant.configure("2") do |config| | |
config.ssh.insert_key = false | |
config.vm.box = "centos/7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
tasks: | |
- name: simulate long running op, allow to run for 16 sec, fire and forget | |
command: "/bin/sleep {{ item }}" | |
async: 16 | |
register: my_async_job | |
poll: 0 | |
loop: [1, 3, 15, 4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Auto create dictionary | |
hosts: [localhost] | |
connection: local | |
vars: | |
ansible_tower: | |
towers_amount: 3 # Make sure this is uneven | |
databases_amount: 1 # Make sure this is uneven | |
prefix: 172.17.202.64/26 | |
tasks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "pfsense" do |subconfig| | |
subconfig.vm.box = "kennyl/pfsense" | |
subconfig.vm.box_version = "2.4.0" | |
subconfig.vm.synced_folder ".", "/vagrant", disabled: true | |
subconfig.vm.network "private_network", virtualbox__intnet: "mynetwork", auto_config: false | |
subconfig.vm.network "forwarded_port", guest: 80, host: 8080 | |
subconfig.vm.network "forwarded_port", guest: 443, host: 8443 | |
subconfig.vm.network "forwarded_port", guest: 3000, host: 3000 | |
subconfig.vm.provider :virtualbox do |vb| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make sure libguestfs-tools package is installed (libguestfs-tools-c on EL) | |
# Make sure current user is in kvm group: sudo usermod $USER -g kvm OR sudo chmod 0666 /dev/kvm | |
# Based on https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one | |
box=ubuntu1804 | |
provider=libvirt | |
if [[ $EUID > 0 ]]; then | |
echo "Please run as root/sudo" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILES=*.rst | |
for f in $FILES | |
do | |
filename="${f%.*}" | |
echo "Converting $f to $filename.md" | |
`pandoc $f -f rst -t markdown -o $filename.md` | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Adapted from Mark Mandel's implementation | |
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py | |
import argparse | |
import json | |
import paramiko | |
import subprocess | |
import sys | |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.source.ansible': | |
'a10_server': | |
'prefix': "a10_server_snippet" | |
'description': "Manage A10 Networks AX/SoftAX/Thunder/vThunder devices' server object." | |
'body': """ | |
a10_server: | |
username: ${1:null} # required. An account with administrator privileges. | |
host: ${2:null} # required. Hostname or IP of the A10 Networks device. | |
password: ${3:null} # required. Password for the C(username) account. | |
server_name: ${4:undefined} # required. The SLB (Server Load Balancer) server name. |