Unify and standardize inventory_hostname

This was causing some confusing conflicts, so create a new fact called
"this_node" which is inventory_hostname.split('.')[0], i.e. the short
name, and use that everywhere instead of an FQDN or true inventory
hostname.
This commit is contained in:
Joshua Boniface
2021-11-11 17:14:34 -05:00
parent 70c7c76605
commit 243c910d6d
11 changed files with 47 additions and 37 deletions

View File

@ -54,21 +54,21 @@ ipmi:
username: "host"
password: ""
hosts:
"pvchv1": # Use the inventory hostname here
hostname: pvchv1-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be
# used here; PVC connects to this *hostname* for fencing.
"pvchv1": # This name MUST match the Ansible inventory_hostname's first portion, i.e. "inventory_hostname.split('.')[0]"
hostname: pvchv1-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be used here and it must resolve to address.
# PVC connects to this *hostname* for fencing.
address: 192.168.100.101
netmask: 255.255.255.0
gateway: 192.168.100.1
"pvchv2": # Use the inventory hostname here
hostname: pvchv2-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be
# used here; PVC connects to this *hostname* for fencing.
"pvchv2": # This name MUST match the Ansible inventory_hostname's first portion, i.e. "inventory_hostname.split('.')[0]"
hostname: pvchv2-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be used here and it must resolve to address.
# PVC connects to this *hostname* for fencing.
address: 192.168.100.102
netmask: 255.255.255.0
gateway: 192.168.100.1
"pvchv3": # Use the inventory hostname here
hostname: pvchv3-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be
# used here; PVC connects to this *hostname* for fencing.
"pvchv3": # This name MUST match the Ansible inventory_hostname's first portion, i.e. "inventory_hostname.split('.')[0]"
hostname: pvchv3-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be used here and it must resolve to address.
# PVC connects to this *hostname* for fencing.
address: 192.168.100.103
netmask: 255.255.255.0
gateway: 192.168.100.1