1 heat_template_version: pike
4 OpenStack containerized Rabbitmq service
9 default: 'tripleoupstream'
13 default: 'centos-binary-rabbitmq:latest'
17 description: Mapping of service endpoint -> protocol. Typically set
18 via parameter_defaults in the resource registry.
22 description: Mapping of service_name -> network name. Typically set
23 via parameter_defaults in the resource registry. This
24 mapping overrides those in ServiceNetMapDefaults.
35 description: Role name on which the service is applied
39 description: Parameters specific to the role
45 type: ../../../puppet/services/rabbitmq.yaml
47 EndpointMap: {get_param: EndpointMap}
48 ServiceNetMap: {get_param: ServiceNetMap}
49 DefaultPasswords: {get_param: DefaultPasswords}
50 RoleName: {get_param: RoleName}
51 RoleParameters: {get_param: RoleParameters}
55 description: Role data for the Rabbitmq API role.
57 service_name: {get_attr: [RabbitmqBase, role_data, service_name]}
60 - {get_attr: [RabbitmqBase, role_data, config_settings]}
61 - rabbitmq::service_manage: false
62 tripleo::profile::pacemaker::rabbitmq_bundle::rabbitmq_docker_image: &rabbitmq_image
65 - - {get_param: DockerNamespace}
66 - {get_param: DockerRabbitmqImage}
67 step_config: &step_config
68 get_attr: [RabbitmqBase, role_data, step_config]
69 service_config_settings: {get_attr: [RabbitmqBase, role_data, service_config_settings]}
70 # BEGIN DOCKER SETTINGS
72 config_volume: rabbitmq
74 step_config: *step_config
75 config_image: *rabbitmq_image
77 /var/lib/kolla/config_files/rabbitmq.json:
78 command: /usr/sbin/pacemaker_remoted
80 - dest: /etc/libqb/force-filesystem-sockets
85 - path: /var/lib/rabbitmq
86 owner: rabbitmq:rabbitmq
88 - path: /var/log/rabbitmq
89 owner: rabbitmq:rabbitmq
91 # When using pacemaker we don't launch the container, instead that is done by pacemaker
97 image: *rabbitmq_image
101 - /var/lib/kolla/config_files/rabbitmq.json:/var/lib/kolla/config_files/config.json:ro
102 - /var/lib/config-data/rabbitmq/etc/rabbitmq:/etc/rabbitmq:ro
103 - /etc/hosts:/etc/hosts:ro
104 - /etc/localtime:/etc/localtime:ro
105 - /var/lib/rabbitmq:/var/lib/rabbitmq
107 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
108 - KOLLA_BOOTSTRAP=True
112 - - 'RABBITMQ_CLUSTER_COOKIE'
115 expression: $.data.passwords.where($ != '').first()
118 - {get_param: RabbitCookie}
119 - {get_param: [DefaultPasswords, rabbit_cookie]}
121 rabbitmq_init_bundle:
133 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
134 - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
136 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
137 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::rabbitmq_bundle'
138 image: *rabbitmq_image
140 - /etc/hosts:/etc/hosts:ro
141 - /etc/localtime:/etc/localtime:ro
142 - /etc/puppet:/tmp/puppet-etc:ro
143 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
144 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
145 - /dev/shm:/dev/shm:rw
147 - name: create /var/lib/rabbitmq
149 path: /var/lib/rabbitmq
151 - name: stop the Erlang port mapper on the host and make sure it cannot bind to the port used by container
153 echo 'export ERL_EPMD_ADDRESS=127.0.0.1' > /etc/rabbitmq/rabbitmq-env.conf
154 echo 'export ERL_EPMD_PORT=4370' >> /etc/rabbitmq/rabbitmq-env.conf
155 for pid in $(pgrep epmd); do if [ "$(lsns -o NS -p $pid)" == "$(lsns -o NS -p 1)" ]; then kill $pid; break; fi; done
157 - name: Stop and disable rabbitmq service
159 service: name=rabbitmq-server state=stopped enabled=no