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: "DNS Management" | |
hosts: tags_lab_nameservers | |
vars: | |
reverse_zone: | |
v4_zonename: "10.in-addr.arpa" | |
v6_zonename: ".ip6.arpa" | |
forward_zonename: "example.net" | |
nameservers: | |
- "ns" |
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: "Build DNS Zonefiles" | |
hosts: localhost | |
vars: | |
zones: | |
- name: "add_here.zone" | |
zonename: "add_here" | |
soa: "ns" | |
settings: | |
ttl: "2d" |
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 | |
gather_facts: true | |
# Before executing ensure that the prerequisites are installed | |
# `ansible-galaxy collection install vmware.vmware_rest` | |
# `python3 -m pip install aiohttp` | |
tasks: | |
- name: "Get The Clusters" | |
vmware.vmware_rest.vcenter_cluster_info: | |
vcenter_hostname: '{{ lookup("env", "VHOSTNAME") }}' |
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 | |
gather_facts: true | |
# Before executing ensure that the prerequisites are installed | |
# `ansible-galaxy collection install vmware.vmware_rest netbox.netbox` | |
# `python3 -m pip install aiohttp pynetbox` | |
# We start with a pre-check playbook, if it fails, we don't want to | |
# make changes | |
any_errors_fatal: true | |
vars_files: |
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 | |
gather_facts: true | |
# Before executing ensure that the prerequisites are installed | |
# `ansible-galaxy collection install vmware.vmware_rest` | |
# `python3 -m pip install aiohttp` | |
# We start with a pre-check playbook, if it fails, we don't want to | |
# make changes | |
any_errors_fatal: true | |
vars_files: |
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 | |
gather_facts: true | |
# Before executing ensure that the prerequisites are installed | |
# `ansible-galaxy collection install vmware.vmware_rest` | |
# `python3 -m pip install aiohttp` | |
tasks: | |
- name: "Build the VM" | |
vmware.vmware_rest.vcenter_vmtemplate_libraryitems: |
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 | |
gather_facts: true | |
# Before executing ensure that the prerequisites are installed | |
# `ansible-galaxy collection install vmware.vmware_rest` | |
# `python3 -m pip install aiohttp` | |
tasks: | |
- name: "Get The Clusters" | |
vmware.vmware_rest.vcenter_cluster_info: | |
vcenter_hostname: '{{ lookup("env", "VHOSTNAME") }}' |
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/python3 | |
# TLS Certificate Checker | |
# Ingest a list of hosts, and return a report (YAML) with expiration dates | |
# Nicholas Schmidt | |
# Imports | |
# Plaintext | |
from ruamel.yaml import YAML | |
import json |
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: nxos_machines | |
tasks: | |
- name: "Gather facts via NXAPI" | |
cisco.nxos.nxos_command: | |
commands: | |
- 'show cfs status' | |
register: nxos_facts_gathered | |
- name: "Print it!" | |
when: 'nxos_facts_gathered.stdout is search("Distribution : Enabled")' |
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: "{{ lookup('env', 'EXEC_HOST') }}" | |
tasks: | |
- name: "Disable cloud-init!" | |
systemd: | |
name: "{{ item }}" | |
enabled: "no" | |
state: "stopped" | |
loop: | |
- "cloud-init" |
NewerOlder