1 heat_template_version: pike
4 OpenStack containerized Rabbitmq service
9 default: 'tripleoupstream'
13 default: 'centos-binary-rabbitmq:latest'
15 DockerRabbitmqConfigImage:
16 description: The container image to use for the rabbitmq config_volume
17 default: 'centos-binary-rabbitmq:latest'
21 description: Mapping of service endpoint -> protocol. Typically set
22 via parameter_defaults in the resource registry.
26 description: Mapping of service_name -> network name. Typically set
27 via parameter_defaults in the resource registry. This
28 mapping overrides those in ServiceNetMapDefaults.
39 description: Role name on which the service is applied
43 description: Parameters specific to the role
49 type: ../../../puppet/services/rabbitmq.yaml
51 EndpointMap: {get_param: EndpointMap}
52 ServiceNetMap: {get_param: ServiceNetMap}
53 DefaultPasswords: {get_param: DefaultPasswords}
54 RoleName: {get_param: RoleName}
55 RoleParameters: {get_param: RoleParameters}
59 description: Role data for the Rabbitmq API role.
61 service_name: {get_attr: [RabbitmqBase, role_data, service_name]}
64 - {get_attr: [RabbitmqBase, role_data, config_settings]}
65 - rabbitmq::service_manage: false
66 tripleo::profile::pacemaker::rabbitmq_bundle::rabbitmq_docker_image: &rabbitmq_image
69 - - {get_param: DockerNamespace}
70 - {get_param: DockerRabbitmqImage}
71 step_config: &step_config
72 get_attr: [RabbitmqBase, role_data, step_config]
73 service_config_settings: {get_attr: [RabbitmqBase, role_data, service_config_settings]}
74 # BEGIN DOCKER SETTINGS
76 config_volume: rabbitmq
78 step_config: *step_config
82 - [ {get_param: DockerNamespace}, {get_param: DockerRabbitmqConfigImage} ]
84 /var/lib/kolla/config_files/rabbitmq.json:
85 command: /usr/sbin/pacemaker_remoted
87 - dest: /etc/libqb/force-filesystem-sockets
92 - path: /var/lib/rabbitmq
93 owner: rabbitmq:rabbitmq
95 - path: /var/log/rabbitmq
96 owner: rabbitmq:rabbitmq
98 # When using pacemaker we don't launch the container, instead that is done by pacemaker
104 image: *rabbitmq_image
108 - /var/lib/kolla/config_files/rabbitmq.json:/var/lib/kolla/config_files/config.json:ro
109 - /var/lib/config-data/rabbitmq/etc/rabbitmq:/etc/rabbitmq:ro
110 - /etc/hosts:/etc/hosts:ro
111 - /etc/localtime:/etc/localtime:ro
112 - /var/lib/rabbitmq:/var/lib/rabbitmq
114 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
115 - KOLLA_BOOTSTRAP=True
119 - - 'RABBITMQ_CLUSTER_COOKIE'
122 expression: $.data.passwords.where($ != '').first()
125 - {get_param: RabbitCookie}
126 - {get_param: [DefaultPasswords, rabbit_cookie]}
128 rabbitmq_init_bundle:
140 - - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
141 - "FACTER_uuid=docker puppet apply --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
143 TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
144 CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::rabbitmq_bundle'
145 image: *rabbitmq_image
147 - /etc/hosts:/etc/hosts:ro
148 - /etc/localtime:/etc/localtime:ro
149 - /etc/puppet:/tmp/puppet-etc:ro
150 - /usr/share/openstack-puppet/modules:/usr/share/openstack-puppet/modules:ro
151 - /etc/corosync/corosync.conf:/etc/corosync/corosync.conf:ro
152 - /dev/shm:/dev/shm:rw
154 - name: create /var/lib/rabbitmq
156 path: /var/lib/rabbitmq
158 - name: stop the Erlang port mapper on the host and make sure it cannot bind to the port used by container
160 echo 'export ERL_EPMD_ADDRESS=127.0.0.1' > /etc/rabbitmq/rabbitmq-env.conf
161 echo 'export ERL_EPMD_PORT=4370' >> /etc/rabbitmq/rabbitmq-env.conf
162 for pid in $(pgrep epmd); do if [ "$(lsns -o NS -p $pid)" == "$(lsns -o NS -p 1)" ]; then kill $pid; break; fi; done
164 - name: Stop and disable rabbitmq service
166 service: name=rabbitmq-server state=stopped enabled=no