Skip to content

Instantly share code, notes, and snippets.

View mrlesmithjr's full-sized avatar

Larry Smith Jr. mrlesmithjr

View GitHub Profile
#! /usr/bin/env python
"""Parses Terraform tfstate to generate Ansible inventory."""
import json
import os
import yaml
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
TERRAFORM_INVENTORY = []
TERRAFORM_ANSIBLE_INVENTORY = (
---
aci_base_ntp_servers:
- 10.1.1.254
aci_base_timezone: p0_UTC
aci_tenants:
- name: BT-Tenant-1
app_profiles: []
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-net
annotations:
cloud.weave.works/launcher-info: |-
{
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods
{{ ansible_managed|comment }}
{% set _groups = [] %}
{% for vm in vms %}
{% if vm['groups'] is defined %}
{% for _group in vm['groups'] %}
{% set _ = _groups.append(_group) %}
{% endfor %}
{% endif %}
{% endfor %}
---
- hosts: localhost
gather_facts: false
become: false
# vars:
# ansible_python_interpreter: /usr/local/bin/python2
tasks:
- name: Managing VMs
vmware_guest:
annotation: Ansible Provisioned
---
# Defines the vSphere Virtual PortGroup that the VMs should be configured on.
vm_network: VSS-VLAN-102
# Defines the vSphere template to use for spinning up VMs
vm_template: ubuntu1604-packer-template
vms:
- name: vm-1
customization:
# Ansible managed
global
# Remote syslog servers
log 10.0.102.102:514 local0
#log-send-hostname
daemon
chroot /var/lib/haproxy
group haproxy
maxconn 40000
- hosts: test_nodes
vars:
_docker_version: 17.12.0
tasks:
- group:
name: docker
state: present
become: true
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels: