7a6c9ac360
Made keystone use repo wide secrets file. Made glance-controller use repo wide secrets file. kill and then remove image Made neutron-controller use repo wide secrets file. Made nova-controller use repo wide secrets file Made nova-compute use repo wide secrets file. Made rabbitmq use repo wide secrets file. Allow creation of admin-openrc.sh in docker. added provider_interfaces. added persistent root folder. make each dir explicitely added missing env vars. mapped kvm machine-id from host
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# Install a docker based rabbitMQ.
|
|
---
|
|
- name: include secrets
|
|
include_vars:
|
|
file: ../../secrets.yml
|
|
name: secrets
|
|
|
|
- include_vars:
|
|
dir: 'vars'
|
|
|
|
- name: install service file.
|
|
template:
|
|
src: files/rabbitmq.service
|
|
dest: /etc/systemd/system/rabbitmq.service
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
|
|
- name: install service file
|
|
command: systemctl daemon-reload
|
|
|
|
- name: make sure service is started
|
|
systemd:
|
|
name: rabbitmq.service
|
|
state: started
|
|
|
|
- name: wait for container to be started
|
|
wait_for:
|
|
port: 5672
|
|
|
|
- name: setup the cluster
|
|
command: "docker exec -i rabbitmq.service {{ item }}"
|
|
with_items:
|
|
- rabbitmqctl stop_app
|
|
- "rabbitmqctl join_cluster rabbit_{{ hostname_node0 }}@{{ hostname_node0 }}"
|
|
- rabbitmqctl start_app
|
|
when: ansible_nodename != hostname_node0
|
|
|
|
- name: create openstack user
|
|
command: "docker exec -i rabbitmq.service {{ item }}"
|
|
with_items:
|
|
- rabbitmqctl add_user openstack "{{ secrets['RABBIT_PASSWORD'] }}"
|
|
- rabbitmqctl set_permissions openstack ".*" ".*" ".*"
|
|
when: ansible_nodename == hostname_node0
|
|
register: command_result
|
|
failed_when: "command_result.rc not in (0, 70)"
|