variable inclusion cleanup

This commit is contained in:
2022-09-21 21:40:24 -04:00
parent 800efa569a
commit 3e2cc3c03a
3 changed files with 18 additions and 42 deletions

View File

@ -5,20 +5,6 @@
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
# --------------------------------------------- #
@ -46,6 +32,11 @@
# TASKS
# --------------------------------------------- #
tasks:
- name: Include required variables for environment
include_vars:
dir: "vars/{{ __pve_env | default('tower_lab') }}"
- name: Include only RHSM role if unregistering
set_fact:
__include_roles: ['jchristianh.lab_setup.rhsm']
@ -53,9 +44,6 @@
- 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 }}"

View File

@ -5,20 +5,6 @@
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
# --------------------------------------------- #
@ -32,6 +18,11 @@
# TASKS
# --------------------------------------------- #
tasks:
- name: Include required variables for environment
include_vars:
dir: "vars/{{ __pve_env | default('tower_lab') }}"
- name : Provision environment
include_role :
name : "{{ lv_provision }}"

19
pve.yml
View File

@ -6,17 +6,9 @@
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"
# --------------------------------------------- #
# INLINE VARIABLES
# --------------------------------------------- #
vars:
# Default action is to create and start
# an environment
@ -27,6 +19,11 @@
tasks:
- name: Include required variables for environment
include_vars:
dir: "vars/{{ __pve_env | default('tower_lab') }}"
# Generate VMIDs once at the start
- name: Include generate_vmid role
include_role: