Fix up property names in case of mixed case hostnames
When deploying a stack that containes mixed-case hostnames
the following error might be triggered:
Debug: try 15/20: /usr/sbin/pcs -f
/var/lib/pacemaker/cib/puppet-cib-backup20180405-8-1sqw3dc property set
--node TEST-STACK34-controller-1 redis-role=true
Debug: Error: Error: unable to set attribute redis-role
Could not map name=TEST-STACK34-controller-1 to a UUID
while the name in the cluster is test-stack34-controller-1
This used to work pre-bundles because we used the facter provided
$::hostname variable which was lower-cased for us. With bundles we
switched to setting cluster properties from the service bootstrap nodes
and so we used the '<service>_short_node_names' hiera key which might
contain mixed-case hostnames.
In order to fix this we just downcase() the short_node_names hiera
string that we loop on so we can get the same behaviour we had on bare
metal.
Tested on an env with mixed-case hostnames:
[root@uppercaseovercloud-controller-0 keystone]# hiera -c /etc/puppet/hiera.yaml rabbitmq_short_node_names
["UPPERCASEOverCloud-controller-0",
"UPPERCASEOverCloud-controller-1",
"UPPERCASEOverCloud-controller-2"]
Reviewed: https:/ /review. openstack. org/571064 /git.openstack. org/cgit/ openstack/ puppet- tripleo/ commit/ ?id=f90011dadbe 2599ccf9ff4469b dea93413c6d0d2
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit f90011dadbe2599 ccf9ff4469bdea9 3413c6d0d2
Author: Michele Baldessari <email address hidden>
Date: Thu May 24 18:47:02 2018 +0200
Fix up property names in case of mixed case hostnames
When deploying a stack that containes mixed-case hostnames lib/pacemaker/ cib/puppet- cib-backup20180 405-8-1sqw3dc property set controller- 1 redis-role=true STACK34- controller- 1 to a UUID controller- 1
the following error might be triggered:
Debug: try 15/20: /usr/sbin/pcs -f
/var/
--node TEST-STACK34-
Debug: Error: Error: unable to set attribute redis-role
Could not map name=TEST-
while the name in the cluster is test-stack34-
This used to work pre-bundles because we used the facter provided _short_ node_names' hiera key which might
$::hostname variable which was lower-cased for us. With bundles we
switched to setting cluster properties from the service bootstrap nodes
and so we used the '<service>
contain mixed-case hostnames.
In order to fix this we just downcase() the short_node_names hiera
string that we loop on so we can get the same behaviour we had on bare
metal.
Tested on an env with mixed-case hostnames: uppercaseovercl oud-controller- 0 keystone]# hiera -c /etc/puppet/ hiera.yaml rabbitmq_ short_node_ names OverCloud- controller- 0", OverCloud- controller- 1", OverCloud- controller- 2"]
[root@
["UPPERCASE
"UPPERCASE
"UPPERCASE
Cluster pcs properties were set correctly: uppercaseovercl oud-controller- 0 keystone]# pcs property |grep rabbitmq vercloud- controller- 0: galera-role=true haproxy-role=true rabbitmq-role=true redis-role=true rmq-node- attr-last- known-rabbitmq= rabbit@ uppercaseovercl oud-controller- 0 vercloud- controller- 1: galera-role=true haproxy-role=true rabbitmq-role=true redis-role=true rmq-node- attr-last- known-rabbitmq= rabbit@ uppercaseovercl oud-controller- 1 vercloud- controller- 2: galera-role=true haproxy-role=true rabbitmq-role=true redis-role=true rmq-node- attr-last- known-rabbitmq= rabbit@ uppercaseovercl oud-controller- 2
[root@
uppercaseo
uppercaseo
uppercaseo
Co-Authored-By: Damien Ciabrini <email address hidden> dd8ade82479a828 817d63143ba 310f8a1173aa6b8 6abfa5dab3d 84979abe9b70e7f 65957b9d26)
Depends-On: Ie240b8a4217827
Closes-bug: #1773219
Change-Id: I5bd49c4a1b13b2
(cherry picked from commit f2484a0bf9e64ff