Skip to content

Instantly share code, notes, and snippets.

View ryanwalder's full-sized avatar

Ryan Walder ryanwalder

  • Farnborough, UK
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryanwalder on github.
  • I am ryanwalder (https://keybase.io/ryanwalder) on keybase.
  • I have a public key ASBZgZb4JSgpCK9YLY27Fjv9MMvyLUnvKTrs3DWPyPSMEwo

To claim this, I am signing this object:

#!/usr/bin/env bash
# Bootstrap salt
if ! mkdir -p /etc/salt/pki/minion; then
echo "Failed to create PKI dir"
exit 1
elif ! echo "master: ${master_ip}" > /etc/salt/minion; then
echo "Failed to set master address"
exit 1
elif ! echo "mine_interval: 1" >> /etc/salt/minion; then
variable "consul_machine_name" { default = "mgtcfgconl" }
resource "vsphere_virtual_machine" "consul" {
count = "3"
name = "${format("%v%02d%v", var.consul_machine_name, count.index + 1, var.environment)}"
num_cpus = "2"
memory = "1024"
guest_id = "${var.guest_id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
variable "consul_machine_name" { default = "mgtcfgconl" }
resource "vsphere_virtual_machine" "consul" {
count = "3"
name = "${format("%v%02d%v", var.consul_machine_name, count.index + 1, var.environment)}"
num_cpus = "2"
memory = "1024"
guest_id = "${var.guest_id}"
datastore_id = "${data.vsphere_datastore.datastore.id}"
resource_pool_id = "${data.vsphere_resource_pool.pool.id}"
curl -sSk http://localhost:8000 \
-d username='terraform' \
-d password='terraform' \
-d eauth=pam \
-d client="wheel" \
-d fun="key.delete" \
-d match="mgtcfgconl02c.*"
# vi: set ft=sh :
red="38;5;1"
light_red="38;5;9"
dark_red="38;5;124"
yellow="38;5;220"
light_yellow="38;5;11"
dark_yellow="38;5;142"
blue="38;5;4"
light_blue="38;5;12"
{% set blah = {
'bob': {
'ip': '123',
'comment': 'foo',
'vol': '/dev/one',
},
'alice': {
'ip': '123',
'comment': 'foo',
'vol': '/dev/one',
{% set id = salt.grains.get('id') %}
{% set sid = id.split('.')[0] %}
{%- set use = sid[0:3] %}
{%- set platform = sid[3:6] %}
{%- set component = sid[6:9] %}
{%- set os = sid[9] %}
{%- set number = sid[10:12] %}
{%- set env = sid[12] %}
{%- set domain = id.split('.')[1:]|join('.') %}
# Get full minion id, should be fqdn
{%- set id = salt.grains.get('id') %}
# Get the hostname
{%- set sid = id.split('.')[0] %}
# Break down the hostname into the chunks we need to generate the pillar
# folder structure
{%- set use = sid[0:3] %} # use: not used within pillar ATM
{%- set platform = sid[3:6] %} # platform
{%- set component = sid[6:9] %} # component
# Get full minion id, should be fqdn
{%- set id = salt.grains.get('id') %}
# Get the hostname
{%- set sid = id.split('.')[0] %}
# Break down the hostname into the chunks we need to generate the pillar
# folder structure
{%- set use = sid[0:3] %} # use: not used within pillar ATM
{%- set platform = sid[3:6] %} # platform
{%- set component = sid[6:9] %} # component