1 heat_template_version: ocata
4 RabbitMQ service with Pacemaker configured with Puppet
9 description: Mapping of service_name -> network name. Typically set
10 via parameter_defaults in the resource registry. This
11 mapping overrides those in ServiceNetMapDefaults.
18 description: Mapping of service endpoint -> protocol. Typically set
19 via parameter_defaults in the resource registry.
24 type: ../rabbitmq.yaml
26 ServiceNetMap: {get_param: ServiceNetMap}
27 DefaultPasswords: {get_param: DefaultPasswords}
28 EndpointMap: {get_param: EndpointMap}
32 description: Role data for the RabbitMQ pacemaker role.
34 service_name: rabbitmq
35 monitoring_subscription: {get_attr: [RabbitMQServiceBase, role_data, monitoring_subscription]}
38 - get_attr: [RabbitMQServiceBase, role_data, config_settings]
39 - rabbitmq::service_manage: false
41 include ::tripleo::profile::pacemaker::rabbitmq
43 - name: get bootstrap nodeid
45 command: hiera bootstrap_nodeid
46 register: bootstrap_node
47 - name: set is_bootstrap_node fact
49 set_fact: is_bootstrap_node={{bootstrap_node.stdout == ansible_hostname}}
50 - name: get rabbitmq policy
52 shell: pcs resource show rabbitmq | grep -q -E "Attributes:.*\"ha-mode\":\"all\""
53 register: rabbit_ha_mode
54 when: is_bootstrap_node
56 - name: set migrate_rabbit_ha_mode fact
58 set_fact: migrate_rabbit_ha_mode={{rabbit_ha_mode.rc == 0}}
59 when: is_bootstrap_node
60 - name: Fixup for rabbitmq ha-queues LP#1668600
61 tags: step0,pre-upgrade
63 nr_controllers=$(($(hiera controller_node_names | grep -o "," |wc -l) + 1))
64 nr_queues=$(($nr_controllers / 2 + ($nr_controllers % 2)))
65 if ! [ $nr_queues -gt 0 -a $nr_queues -le $nr_controllers ]; then
66 echo "ERROR: The nr. of HA queues during the rabbit upgrade is out of range: $nr_queues"
69 pcs resource update rabbitmq set_policy='ha-all ^(?!amq\\.).* {"ha-mode":"exactly","ha-params":'"$nr_queues}" --wait=600
70 when: is_bootstrap_node and migrate_rabbit_ha_mode