Comment 9 for bug 1658670

Revision history for this message
Nagaraj Hegde (nhegde) wrote :

Hi,
In the conversation it is mentioned that because of role failure in rabbit_host_group[0] the var is not set. But actually what happened is that:
In inventory we had three Ip for example:
[amqp]
1.1.1.1
2.2.2.2
3.3.3.3

when we run only rabbitmq ansible playbook then the installation order is 1.1.1.1,2.2.2.2 and 3.3.3.3 and installation is successful.

But when we try to install rqbbitmq along with NGINX,Keepalived (order: NGINX installed first ,then keepalived and then rabbitmq) then when rabbitmq installation triggered the first node started will be random (some time it will start with 2.2.2.2 and then 1.1.1.1 or 3.3.3.3, 2.2.2.2 and then 1.1.1.1). When the order is not according to the inventory then the logic inside the file rabbitmq_ssl_self_signed.yml will not hold good.

the logic under rabbitmq_ssl_self_signed.yml is like:
- include: rabbitmq_ssl_key_store.yml
  when: inventory_hostname == groups[rabbitmq_host_group][0],
which is index based, this will fail if the rabbitmq installation started on node 3 (3.3.3.3) and not according to inventory order. rabbitmq_ssl_key_store.yml is the file will be setting the fact 'rabbitmq_ssl_key_fact'. Since the condition failed because of random order it will not set the fact and it will directly invoke the rabbitmq_ssl_key_distribute.yml. This call fail as the fact is not set. And fact is not set because the rabbitmq installation first started on node 3 instead of node 1 (or not on groups[rabbitmq_host_group][0]).

Please see the attached log for the way the installation of rabbitMq triggered and search for string "openstack-ansible-rabbitmq_server : Print host name" the first task started is on ip 172.29.39.239 but the inventory order is 172.29.39.180, 172.29.39.181, 172.29.39.239 respectively.
Please kindly check.