diff --git a/group_vars/default/base.yml b/group_vars/default/base.yml index 4289d0d..6a45f25 100644 --- a/group_vars/default/base.yml +++ b/group_vars/default/base.yml @@ -35,19 +35,19 @@ ipmi: username: "host" password: "" hosts: - "pvchv1": + "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. address: 192.168.100.101 netmask: 255.255.255.0 gateway: 192.168.100.1 - "pvchv2": + "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. address: 192.168.100.102 netmask: 255.255.255.0 gateway: 192.168.100.1 - "pvchv3": + "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. address: 192.168.100.103 diff --git a/group_vars/default/pvc.yml b/group_vars/default/pvc.yml index 6cf03d9..fbf7dc5 100644 --- a/group_vars/default/pvc.yml +++ b/group_vars/default/pvc.yml @@ -93,7 +93,7 @@ pvc_nodes: upstream_ip: "192.168.100.11" cluster_ip: "10.0.0.1" storage_ip: "10.0.1.1" - ipmi_host: "{{ ipmi['hosts']['pvchv1']['hostname'] }}" # Note the node hostname key in here + ipmi_host: "{{ ipmi['hosts']['pvchv1']['hostname'] }}" # Note the node inventory hostname key in here ipmi_user: "{{ ipmi['users']['pvc']['username'] }}" ipmi_password: "{{ ipmi['users']['pvc']['password'] }}" - hostname: "pvchv2" @@ -103,7 +103,7 @@ pvc_nodes: upstream_ip: "192.168.100.12" cluster_ip: "10.0.0.2" storage_ip: "10.0.1.2" - ipmi_host: "{{ ipmi['hosts']['pvchv2']['hostname'] }}" # Note the node hostname key in here + ipmi_host: "{{ ipmi['hosts']['pvchv2']['hostname'] }}" # Note the node inventory hostname key in here ipmi_user: "{{ ipmi['users']['pvc']['username'] }}" ipmi_password: "{{ ipmi['users']['pvc']['password'] }}" - hostname: "pvchv3" @@ -113,7 +113,7 @@ pvc_nodes: upstream_ip: "192.168.100.13" cluster_ip: "10.0.0.3" storage_ip: "10.0.1.3" - ipmi_host: "{{ ipmi['hosts']['pvchv3']['hostname'] }}" # Note the node hostname key in here + ipmi_host: "{{ ipmi['hosts']['pvchv3']['hostname'] }}" # Note the node inventory hostname key in here ipmi_user: "{{ ipmi['users']['pvc']['username'] }}" ipmi_password: "{{ ipmi['users']['pvc']['password'] }}" diff --git a/roles/base/templates/etc/network/interfaces.d/ipmi.j2 b/roles/base/templates/etc/network/interfaces.d/ipmi.j2 index 42ab066..572ef52 100644 --- a/roles/base/templates/etc/network/interfaces.d/ipmi.j2 +++ b/roles/base/templates/etc/network/interfaces.d/ipmi.j2 @@ -1,5 +1,5 @@ iface ipmi inet manual pre-up ipmitool lan set 1 ipsrc static - pre-up ipmitool lan set 1 ipaddr {{ ipmi['hosts'][ansible_hostname]['address'] }} - pre-up ipmitool lan set 1 netmask {{ ipmi['hosts'][ansible_hostname]['netmask'] }} - pre-up ipmitool lan set 1 defgw ipaddr {{ ipmi['hosts'][ansible_hostname]['gateway'] }} + pre-up ipmitool lan set 1 ipaddr {{ ipmi['hosts'][inventory_hostname]['address'] }} + pre-up ipmitool lan set 1 netmask {{ ipmi['hosts'][inventory_hostname]['netmask'] }} + pre-up ipmitool lan set 1 defgw ipaddr {{ ipmi['hosts'][inventory_hostname]['gateway'] }}