View hosts.inv.j2
{{ 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 %}
View provision-vms.yml
---
- hosts: localhost
gather_facts: false
become: false
# vars:
# ansible_python_interpreter: /usr/local/bin/python2
tasks:
- name: Managing VMs
vmware_guest:
annotation: Ansible Provisioned
View vms.yml
---
# 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:
View haproxy.cfg
# 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
View ansible_install_docker_from_binary_source.yml
- hosts: test_nodes
vars:
_docker_version: 17.12.0
tasks:
- group:
name: docker
state: present
become: true
View k8s-influxdb.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
View gist:7ee68379e3876563f6749e8c7ca42775
- name: Discovery EPG To Domains
aci_epg_to_domain:
hostname: "{{ aci_discovery_apic_controller }}"
password: "{{ aci_discovery_password }}"
state: query
tenant: "{{ item }}"
username: "{{ aci_discovery_username }}"
validate_certs: false
register: _aci_discovered_epg_domains
with_items: "{{ aci_discovered_tenants }}"
View gist:039a7bccf342e456dc6f9cbb2474c995
- hosts: all
tasks:
- name: Ansible check directory exists.
stat:
path=/etc/yum.repos.d
register: p
- debug:
msg: "Path exists and is a directory"
when: p.stat.isdir is defined and p.stat.isdir
View aci_discovery.yml.j2
---
tenants:
{% for tenant in aci_discovered_tenants %}
{{ tenant }}:
{% for _ap_tenants in _aci_discovered_aps['results'] %}
{% for _ap_tenant in _ap_tenants['existing'] %}
{% if _ap_tenant['fvTenant']['attributes']['name'] == tenant %}
{% if _ap_tenant['fvTenant']['children'] is defined %}
app_profiles:
{% for ap in _ap_tenant['fvTenant']['children'] %}
View nxos_interface
- name: configure loopback interface address
nxos_ip_interface:
addr: 1.1.1.1
host: "{{ ansible_host }}"
interface: loopback 0
mask: 24
password: "{{ ansible_net_password }}"
state: present
transport: cli
username: "{{ ansible_net_username }}"