initial project commit

This commit is contained in:
Chris Hammer 2022-09-21 21:27:22 -04:00
commit cff95367ac
32 changed files with 1169 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
vault/*
unused
tower_grafana_dashboards
old.templates
notes
files/*
facts.d
collections/ansible_collections

26
ansible.cfg Normal file
View File

@ -0,0 +1,26 @@
[defaults]
inventory = inventory/infra_hosts
roles_path = roles
collections_path = /etc/ansible/collections
remote_tmp = /tmp/.ansible-${USER}/tmp
gathering = smart
gather_timeout = 300
fact_path = facts.d
fact_caching = jsonfile
fact_caching_connection = facts.d
fact_caching_timeout = 300
retry_files_enabled = False
forks = 40
timeout = 30
host_key_checking = False
display_skipped_hosts = False
bin_ansible_callbacks = True
callback_whitelist = ansible.posix.profile_tasks, ansible.posix.timer
deprecation_warnings = False
command_warnings = False
[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o PreferredAuthentications=publickey

View File

@ -0,0 +1,19 @@
---
collections:
# Official/Community collections
- name: ansible.posix
- name: community.general
- name: community.crypto
# Main collections
- name: https://github.com/jchristianh-ansible-collections/pve.git
type: git
version: main
- name: https://github.com/jchristianh-ansible-collections/lab_setup.git
type: git
version: main
...

12
create.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
ansible-playbook pve.yml --limit nvme_lab
read -p 'Has pve.yml completed successfully? (y/n) ' pve_complete
if [ $pve_complete = 'y' ]
then
echo 'Continuing run...'
ansible-playbook -i inventory/lab_hosts manage_nodes.yml --ask-vault-pass
ansible-playbook -i inventory/lab_hosts prometheus.yml
ansible-playbook -i inventory/lab_hosts grafana.yml
fi

12
create_nvme_lab.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
ansible-playbook pve.yml -e __pve_env=nvme_lab
read -p 'Has pve.yml completed successfully? (y/n) ' pve_complete
if [ $pve_complete = 'y' ]
then
echo 'Continuing run...'
ansible-playbook -i inventory/lab_hosts manage_nodes.yml --ask-vault-pass
ansible-playbook -i inventory/lab_hosts prometheus.yml
ansible-playbook -i inventory/lab_hosts grafana.yml
fi

28
deploy_ssh_keys.yml Normal file
View File

@ -0,0 +1,28 @@
---
- name: Provision PVE Managed Hosts
hosts: all
become: yes
gather_facts: yes
# --------------------------------------------- #
# INLINE VARS
# --------------------------------------------- #
vars:
# roles to include
__include_roles:
- jchristianh.lab_setup.ssh_keypair
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

4
destroy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
ansible-playbook -i inventory/lab_hosts manage_nodes.yml --ask-vault-pass -e '{ __rhsm_register: False }'
ansible-playbook pve.yml -e __run_action=destroy

4
destroy_nvme_lab.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
ansible-playbook -i inventory/lab_hosts manage_nodes.yml --ask-vault-pass -e '{ __rhsm_register: False }'
ansible-playbook pve.yml -e __run_action=destroy -e __pve_env=nvme_lab

28
grafana.yml Normal file
View File

@ -0,0 +1,28 @@
---
- name: Provision PVE Managed Hosts
hosts: grafana
become: yes
gather_facts: yes
# --------------------------------------------- #
# INLINE VARS
# --------------------------------------------- #
vars:
# roles to include
__include_roles:
- jchristianh.lab_setup.grafana
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

2
inventory/infra_hosts Normal file
View File

@ -0,0 +1,2 @@
localhost ansible_connection=local

107
inventory/lab_hosts Normal file
View File

@ -0,0 +1,107 @@
# Lab Environment Inventory
#################################################
#
# Configuration : lab_hosts
# Template Version : 1.0-220908.1055
#
# Chris Hammer <chris@thezengarden.net>
#################################################
#########################
# Environment Overview #
# -------------------- #
# KEY: #
# Node :: Group :: IP #
#########################
# lab-tower-1 :: aap_lab_nodes :: 10.87.6.46 :: zg-vm-dev4
# lab-tower-2 :: aap_lab_nodes :: 10.87.6.47 :: zg-vm-dev4
# lab-db-1 :: aap_lab_db :: 10.87.6.48 :: zg-vm-dev4
# lab-iso-exec-1 :: aap_lab_isoexec :: 10.87.6.49 :: zg-vm-dev4
# lab-dev-1 :: aap_lab_dev :: 10.87.6.50 :: zg-vm-dev4
# lab-dev-2 :: aap_lab_dev :: 10.87.6.51 :: zg-vm-dev4
# lab-dev-3 :: aap_lab_dev :: 10.87.6.52 :: zg-vm-dev4
# lab-test-1 :: aap_lab_test :: 10.87.6.53 :: zg-vm-dev4
# lab-test-2 :: aap_lab_test :: 10.87.6.54 :: zg-vm-dev4
# lab-test-3 :: aap_lab_test :: 10.87.6.55 :: zg-vm-dev4
# lab-prod-1 :: aap_lab_prod :: 10.87.6.56 :: zg-vm-dev4
# lab-prod-2 :: aap_lab_prod :: 10.87.6.57 :: zg-vm-dev4
# lab-prod-3 :: aap_lab_prod :: 10.87.6.58 :: zg-vm-dev4
# lab-grafana-1 :: grafana :: 10.87.6.59 :: zg-vm-dev4
# lab-prometheus-1 :: prometheus :: 10.87.6.60 :: zg-vm-dev4
###################
### HOST GROUPS ###
###################
[aap_lab_nodes]
lab-tower-1 ansible_host=10.87.6.46
lab-tower-2 ansible_host=10.87.6.47
[aap_lab_isoexec]
lab-iso-exec-1 ansible_host=10.87.6.49
[aap_lab_dev]
lab-dev-1 ansible_host=10.87.6.50
lab-dev-2 ansible_host=10.87.6.51
lab-dev-3 ansible_host=10.87.6.52
[aap_lab_test]
lab-test-1 ansible_host=10.87.6.53
lab-test-2 ansible_host=10.87.6.54
lab-test-3 ansible_host=10.87.6.55
[aap_lab_prod]
lab-prod-1 ansible_host=10.87.6.56
lab-prod-2 ansible_host=10.87.6.57
lab-prod-3 ansible_host=10.87.6.58
[aap_lab_db]
lab-db-1 ansible_host=10.87.6.48
[aap_lab_control_nodes]
[grafana]
lab-grafana-1 ansible_host=10.87.6.59
[prometheus]
lab-prometheus-1 ansible_host=10.87.6.60
[unassigned]
#################
### SUBGROUPS ###
#################
[aap_lab__all__envs:children]
aap_lab_dev
aap_lab_test
aap_lab_prod
aap_lab_db
unassigned
[aap_lab__all__envs:vars]
ansible_user=root
[aap_lab__all__nodes:children]
aap_lab_nodes
aap_lab_isoexec
aap_lab_dev
aap_lab_test
aap_lab_prod
aap_lab_db
aap_lab_control_nodes
grafana
prometheus
unassigned
[aap_lab__all__nodes:vars]
ansible_user=root
# vars for all hosts/groups
[all:vars]
ansible_ssh_common_args='-J root@10.1.1.86'

67
manage_nodes.yml Normal file
View File

@ -0,0 +1,67 @@
---
- name: Provision PVE Managed Hosts
hosts: all
become: yes
gather_facts: yes
# --------------------------------------------- #
# INCLUDED VARIABLES
# --------------------------------------------- #
vars_files:
- "vars/{{ __pve_env | default('tower_lab') }}/defaults.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/environment_packages.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/inventory_vars.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/lab_nodes.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/network.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/prometheus.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/ssh_keypair.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/template_defaults.yml"
# --------------------------------------------- #
# INLINE VARIABLES
# --------------------------------------------- #
vars:
# register rhel systems by default
__rhsm_register : yes
# update environment to latest packages
__update_hosts : yes
# roles to include
__include_roles:
- jchristianh.lab_setup.ssh_keypair
- jchristianh.lab_setup.set_hostname
- jchristianh.lab_setup.deploy_etc_hosts
- jchristianh.lab_setup.bashrc
- jchristianh.lab_setup.rhsm # this role includes a vault; use
# --ask-vault-pass when uncommenting
- jchristianh.lab_setup.base_pkgs
# - jchristianh.lab_setup.ansible_setup
- jchristianh.lab_setup.node_exporter
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name: Include only RHSM role if unregistering
set_fact:
__include_roles: ['jchristianh.lab_setup.rhsm']
when:
- not __rhsm_register|bool
# we can use set_fact with __include_roles; append rhsm if __rhsm_register == yes
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

29
node_exporter.yml Normal file
View File

@ -0,0 +1,29 @@
---
- name: Provision PVE Managed Hosts
hosts: all
become: yes
gather_facts: yes
# --------------------------------------------- #
# INLINE VARS
# --------------------------------------------- #
vars:
# roles to include
__include_roles:
- jchristianh.lab_setup.node_exporter
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

43
prometheus.yml Normal file
View File

@ -0,0 +1,43 @@
---
- name: Provision PVE Managed Hosts
hosts: prometheus
become: yes
gather_facts: yes
# --------------------------------------------- #
# INCLUDED VARIABLES
# --------------------------------------------- #
vars_files:
- "vars/{{ __pve_env | default('tower_lab') }}/defaults.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/environment_packages.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/inventory_vars.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/lab_nodes.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/network.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/prometheus.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/ssh_keypair.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/template_defaults.yml"
# --------------------------------------------- #
# INLINE VARS
# --------------------------------------------- #
vars:
# roles to include
__include_roles:
- jchristianh.lab_setup.prometheus
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

133
pve.yml Normal file
View File

@ -0,0 +1,133 @@
---
- name: Managed PVE Environment
hosts: localhost
connection: local
become: no
gather_facts: no
vars_files:
- "vars/{{ __pve_env | default('tower_lab') }}/defaults.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/environment_packages.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/inventory_vars.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/lab_nodes.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/network.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/prometheus.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/ssh_keypair.yml"
- "vars/{{ __pve_env | default('tower_lab') }}/template_defaults.yml"
vars:
# Default action is to create and start
# an environment
#
# Available values:
# create|start|stop|shutdown|map|snapshot|rollback|destroy
__run_action: 'create'
tasks:
# Generate VMIDs once at the start
- name: Include generate_vmid role
include_role:
name: jchristianh.pve.generate_vmid
# Creates the managed nodes and powers them on
- name: Create Environment
include_role:
name: "{{ lv_pve_create_roles }}"
loop:
- jchristianh.pve.ssh_keygen
- jchristianh.pve.create_vms
- jchristianh.pve.configure_vms
- jchristianh.pve.start_vms
loop_control:
loop_var: lv_pve_create_roles
when:
- __run_action == 'create'
# Create an Ansible inventory for manage_nodes.yml
# and an `/etc/hosts` file for deployment to the managed
# nodes
- name: Map Environment
include_role:
name: "{{ lv_pve_map_env }}"
loop:
- jchristianh.pve.get_vm_ipaddr
- jchristianh.pve.create_ansible_inventory
- jchristianh.pve.create_etc_hosts
loop_control:
loop_var: lv_pve_map_env
when:
- __run_action == 'map' or
__run_action == 'create'
# Called either at the end of the environment creation
# or at will (ie: -e __run_action=snapshot)
#
# (this will only create a single snapshot whose name
# is defined in the '__lab_snapshot_name' var; if snapshot
# of this name already exists snapshot creation is skipped)
- name: Snapshot Environment
include_role:
name: jchristianh.pve.create_snapshots
when:
- __run_action == 'snapshot' or
__run_action == 'create'
# Provides the ability to rollback the environment
# to the initial provisioned state
- name: Rollback Environment
include_role:
name: "{{ lv_pve_rollback_vms }}"
loop:
- jchristianh.pve.rollback_vms
- jchristianh.pve.configure_vms
- jchristianh.pve.start_vms
loop_control:
loop_var: lv_pve_rollback_vms
when:
- __run_action == 'rollback'
# Stops all managed nodes and destroys them
- name: Destroy Environment
include_role:
name: "{{ lv_pve_destroy_roles }}"
loop:
- jchristianh.pve.stop_vms
- jchristianh.pve.destroy_vms
loop_control:
loop_var: lv_pve_destroy_roles
when:
- __run_action == 'destroy'
# Starts all managed nodes
- name: Start VMs
include_role:
name: jchristianh.pve.start_vms
when:
- __run_action == 'start'
# Hard stops (power off) all managed nodes
- name: Stop VMs
include_role:
name: jchristianh.pve.stop_vms
when:
- __run_action == 'stop'
# Shuts down all managed nodes gracefully
- name: Shutdown VMs
include_role:
name: jchristianh.pve.shutdown_vms
when:
- __run_action == 'shutdown'
...

30
ssh_key_pair.yml Normal file
View File

@ -0,0 +1,30 @@
---
- name: Managed PVE Environment
hosts: localhost
connection: local
become: no
gather_facts: no
# --------------------------------------------- #
# INLINE VARS
# --------------------------------------------- #
vars:
# roles to include
__include_roles:
- jchristianh.pve.ssh_keygen
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...

View File

@ -0,0 +1,45 @@
---
__project_maintainer : Chris Hammer
__project_maintainer_email : chris@thezengarden.net
__pve_tld : thezengarden.net
__pve_token : 'PVEAPIToken=root@pam!ansible-dev=d6f95c29-6e4b-48b3-9b6a-a86b791d2902'
__pve_node : zg-vm-dev4
__pve_endpoint : "https://{{ __pve_node }}.{{ __pve_tld }}:8006/api2/json"
__pve_template_host: zg-vm-dev4
__api_retries: 12
__api_polling: 5
#__api_retries: 1
#__api_polling: 3
__vm_start_delay: 5
__vm_tmpl_id : 202209012 # RHEL-7-03
#__vm_tmpl_id : 202208112 # RHEL-86-02
__lab_cores_default : 2
__lab_mem_default : .25
__lab_snapshot_name: aap_lab
__use_bastion : yes
__bastion_user : root
__bastion_host : 10.1.1.86
...

View File

@ -0,0 +1,44 @@
---
__environment_packages:
redhat_7:
- nfs-utils
- tar
- zip
- git
- httpd-tools
- net-tools
redhat_8:
- nfs-utils
- python36
- tar
- zip
- git
- httpd-tools
- python3-libsemanage
- tree
- wget
- net-tools
centos_9:
- nfs-utils
- python3
- tar
- zip
- git
- httpd-tools
- tree
- wget
- net-tools
debian_11:
- nfs-common
- python3
- tar
- zip
- git
- apache2-utils
- tree
...

View File

@ -0,0 +1,46 @@
---
__default_inventory_group: unassigned
lab_groups:
- aap_lab_nodes
- aap_lab_isoexec
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- aap_lab_control_nodes
- grafana
- prometheus
- "{{ __default_inventory_group }}"
lab_parents:
aap_lab__all__envs:
groups:
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- "{{ __default_inventory_group }}"
vars:
- "ansible_user=root"
aap_lab__all__nodes:
groups:
- aap_lab_nodes
- aap_lab_isoexec
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- aap_lab_control_nodes
- grafana
- prometheus
- "{{ __default_inventory_group }}"
vars:
- "ansible_user=root"
...

109
vars/nvme_lab/lab_nodes.yml Normal file
View File

@ -0,0 +1,109 @@
---
# PVE vmid's will start at this number
# and increment from there...
lab_vmid_base: 4400
lab_nodes:
# # RHEL 8.6 Hosts:
# # (or default template)
# #######################
# - name : lab-aap-1
# group : aap_lab_nodes
# cores : 4
# mem : 4
#
# - name : lab-db-1
# group : aap_lab_db
# cores : 4
# mem : 4
#
# - name : lab-iso-exec-1
# group : aap_lab_isoexec
# cores : 8
# mem : 16
#
# - name : lab-iso-exec-2
# group : aap_lab_isoexec
# cores : 8
# mem : 16
- name : lab-tower-1
group : aap_lab_nodes
cores : 4
mem : 4
- name : lab-tower-2
group : aap_lab_nodes
cores : 4
mem : 4
- name : lab-db-1
group : aap_lab_db
cores : 4
mem : 4
- name : lab-iso-exec-1
group : aap_lab_isoexec
cores : 8
mem : 8
# - name : lab-iso-exec-2
# group : aap_lab_isoexec
# cores : 8
# mem : 8
# nodes for playing with
########################
- name : lab-dev-1
group : aap_lab_dev
vm_template_id : 202209011
- name : lab-dev-2
group : aap_lab_dev
vm_template_id : 202209011
- name : lab-dev-3
group : aap_lab_dev
vm_template_id : 202209011
- name : lab-test-1
group : aap_lab_test
vm_template_id : 202209011
- name : lab-test-2
group : aap_lab_test
vm_template_id : 202209011
- name : lab-test-3
group : aap_lab_test
vm_template_id : 202209011
- name : lab-prod-1
group : aap_lab_prod
vm_template_id : 202209011
- name : lab-prod-2
group : aap_lab_prod
vm_template_id : 202209011
- name : lab-prod-3
group : aap_lab_prod
vm_template_id : 202209011
- name : lab-grafana-1
vm_template_id : 202209011
group : grafana
cores : 2
mem : 2
- name : lab-prometheus-1
vm_template_id : 202209011
group : prometheus
cores : 2
mem : 2
...

View File

@ -0,0 +1,6 @@
---
__lab_bridge : vmbr0
__lab_vlan : 876
...

View File

@ -0,0 +1,23 @@
---
__prometheus_global:
- name : scrape_interval
value : 15s
- name : evaluation_interval
value : 15s
- name : scrape_timeout
value : 15s
__prometheus_jobs:
- name: AAP2
metrics_path: /api/v2/metrics
scrape_interval: 5s
scheme: https
bearer_token: 2ffEZgnHoJyMKIt5fX6RTvAWQ3fIKz
targets:
- tower2.thezengarden.net
...

View File

@ -0,0 +1,9 @@
---
__ssh_keypair_name : id_rsa
__ssh_keypair_dest : "{{ playbook_dir }}/files"
__ssh_keypair_size : 4096
__ssh_keypair_type : rsa
__ssh_authorized_file : /root/.ssh/authorized_keys
...

View File

@ -0,0 +1,26 @@
---
lab_template_header: Lab Environment
lab_inv_dest : "{{ playbook_dir }}/inventory"
lab_inv_file : lab_hosts
lab_inv_tmpl : templates/ansible_inventory.j2
lab_inv_ver : 1.0
lab_inv_rev : 220908.1055
etc_hosts_dest : "{{ playbook_dir }}/files/hosts"
etc_hosts_tmpl : templates/etc_hosts.j2
etc_hosts_file : /etc/hosts
etc_hosts_ver : 1.0
etc_hosts_rev : 220818.1017
prometheus_config_tmpl : templates/prometheus_yml.j2
prometheus_config_file : /etc/prometheus/prometheus.yml
prometheus_config_ver : 1.0
prometheus_config_rev : 220828.2233
...

View File

@ -0,0 +1,40 @@
---
__project_maintainer : Chris Hammer
__project_maintainer_email : chris@thezengarden.net
__pve_tld : thezengarden.net
__pve_token : 'PVEAPIToken=root@pam!ansible=e2356d3b-2141-4c90-866e-5ee997e301e3'
__pve_node : zg-vm-dev
__pve_endpoint : "https://{{ __pve_node }}.{{ __pve_tld }}:8006/api2/json"
__pve_template_host: zg-vm-dev
__api_retries: 12
__api_polling: 5
#__api_retries: 1
#__api_polling: 3
__vm_start_delay: 5
__vm_tmpl_id : 202209012 # RHEL-7-03
#__vm_tmpl_id : 202208112 # RHEL-86-02
__lab_cores_default : 2
__lab_mem_default : .25
__lab_snapshot_name: aap_lab
...

View File

@ -0,0 +1,44 @@
---
__environment_packages:
redhat_7:
- nfs-utils
- tar
- zip
- git
- httpd-tools
- net-tools
redhat_8:
- nfs-utils
- python36
- tar
- zip
- git
- httpd-tools
- python3-libsemanage
- tree
- wget
- net-tools
centos_9:
- nfs-utils
- python3
- tar
- zip
- git
- httpd-tools
- tree
- wget
- net-tools
debian_11:
- nfs-common
- python3
- tar
- zip
- git
- apache2-utils
- tree
...

View File

@ -0,0 +1,49 @@
---
__default_inventory_group: unassigned
lab_groups:
- aap_lab_nodes
- aap_lab_isoexec
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- aap_lab_control_nodes
- aap_lab_dhcp
- grafana
- prometheus
- "{{ __default_inventory_group }}"
lab_parents:
aap_lab__all__envs:
groups:
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- aap_lab_dhcp
- "{{ __default_inventory_group }}"
vars:
- "ansible_user=root"
aap_lab__all__nodes:
groups:
- aap_lab_nodes
- aap_lab_isoexec
- aap_lab_dev
- aap_lab_test
- aap_lab_prod
- aap_lab_db
- aap_lab_control_nodes
- aap_lab_dhcp
- grafana
- prometheus
- "{{ __default_inventory_group }}"
vars:
- "ansible_user=root"
...

View File

@ -0,0 +1,112 @@
---
# PVE vmid's will start at this number
# and increment from there...
lab_vmid_base: 2200
lab_nodes:
# # RHEL 8.6 Hosts:
# # (or default template)
# #######################
# - name : lab-aap-1
# group : aap_lab_nodes
# cores : 4
# mem : 4
#
# - name : lab-db-1
# group : aap_lab_db
# vm_host : zg-vm-dev2
# cores : 4
# mem : 4
#
# - name : lab-iso-exec-1
# group : aap_lab_isoexec
# cores : 8
# mem : 16
#
# - name : lab-iso-exec-2
# group : aap_lab_isoexec
# vm_host : zg-vm-dev2
# cores : 8
# mem : 16
- name : lab-tower-1 # vm2
group : aap_lab_nodes
vm_host : zg-vm-dev3
cores : 8
mem : 8
- name : lab-tower-2 # vm1
group : aap_lab_nodes
cores : 8
mem : 8
- name : lab-db-1 # vm4
group : aap_lab_db
vm_host : zg-vm-dev2
cores : 4
mem : 4
- name : lab-iso-exec-1 # vm1
group : aap_lab_isoexec
cores : 16
mem : 16
- name : lab-iso-exec-2 # vm4
group : aap_lab_isoexec
vm_host : zg-vm-dev2
cores : 16
mem : 16
# nodes for playing with
########################
- name : lab-dev-1
vm_template_id : 202209011
- name : lab-dev-2
vm_template_id : 202209011
vm_host : zg-vm-dev2
- name : lab-dev-3
vm_template_id : 202209011
vm_host : zg-vm-dev3
- name : lab-test-1
vm_template_id : 202209011
- name : lab-test-2
vm_template_id : 202209011
vm_host : zg-vm-dev2
- name : lab-test-3
vm_template_id : 202209011
vm_host : zg-vm-dev3
- name : lab-prod-1
vm_template_id : 202209011
- name : lab-prod-2
vm_template_id : 202209011
vm_host : zg-vm-dev2
- name : lab-prod-3
vm_template_id : 202209011
vm_host : zg-vm-dev3
- name : lab-grafana-1
vm_template_id : 202209011
group : grafana
cores : 4
mem : 4
- name : lab-prometheus-1
vm_host : zg-vm-dev2
vm_template_id : 202209011
group : prometheus
cores : 4
mem : 4
...

View File

@ -0,0 +1,6 @@
---
__lab_bridge : vmbr0
__lab_vlan : 42
...

View File

@ -0,0 +1,23 @@
---
__prometheus_global:
- name : scrape_interval
value : 15s
- name : evaluation_interval
value : 15s
- name : scrape_timeout
value : 15s
__prometheus_jobs:
- name: AAP2
metrics_path: /api/v2/metrics
scrape_interval: 5s
scheme: https
bearer_token: 2ffEZgnHoJyMKIt5fX6RTvAWQ3fIKz
targets:
- tower2.thezengarden.net
...

View File

@ -0,0 +1,9 @@
---
__ssh_keypair_name : id_rsa
__ssh_keypair_dest : "{{ playbook_dir }}/files"
__ssh_keypair_size : 4096
__ssh_keypair_type : rsa
__ssh_authorized_file : /root/.ssh/authorized_keys
...

View File

@ -0,0 +1,26 @@
---
lab_template_header: Lab Environment
lab_inv_dest : "{{ playbook_dir }}/inventory"
lab_inv_file : lab_hosts
lab_inv_tmpl : templates/ansible_inventory.j2
lab_inv_ver : 1.0
lab_inv_rev : 220802.954
etc_hosts_dest : "{{ playbook_dir }}/files/hosts"
etc_hosts_tmpl : templates/etc_hosts.j2
etc_hosts_file : /etc/hosts
etc_hosts_ver : 1.0
etc_hosts_rev : 220818.1017
prometheus_config_tmpl : templates/prometheus_yml.j2
prometheus_config_file : /etc/prometheus/prometheus.yml
prometheus_config_ver : 1.0
prometheus_config_rev : 220828.2233
...