pve/manage_nodes.yml

69 lines
1.7 KiB
YAML

---
- name: Provision PVE Managed Hosts
hosts: all
become: true
gather_facts: false
# --------------------------------------------- #
# INLINE VARIABLES
# --------------------------------------------- #
vars:
# register rhel systems by default
__rhsm_register : yes
# update environment to latest packages
__update_hosts : no
# 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
# --------------------------------------------- #
# PRE-TASKS
# --------------------------------------------- #
pre_tasks:
- name: Wait for host SSH connection
wait_for_connection:
timeout : 300
# --------------------------------------------- #
# TASKS
# --------------------------------------------- #
tasks:
- name: Gather facts for host
setup:
- 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']
when:
- not __rhsm_register|default('no')|bool
- name : Provision environment
include_role :
name : "{{ lv_provision }}"
loop : "{{ __include_roles }}"
loop_control :
loop_var : lv_provision
...