Merge "Convert rabbitmq to named volume"

This commit is contained in:
Jenkins 2016-02-01 10:37:38 +00:00 committed by Gerrit Code Review
commit b3c205dd40
2 changed files with 11 additions and 18 deletions

View File

@ -1,19 +1,10 @@
--- ---
# TODO(SamYaple): Improve check with a custom docker module to check if alive - name: Creating rabbitmq volume
- name: Checking if a rabbitmq_data exists
command: docker exec rabbitmq_data stat /var/lib/rabbitmq/.erlang.cookie
register: exists
changed_when: False
failed_when: False
always_run: True
- name: Starting rabbitmq-data container
kolla_docker: kolla_docker:
action: "start_container" action: "create_volume"
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ rabbitmq_data_image_full }}" name: "rabbitmq"
name: "rabbitmq_data" register: rabbitmq_volume
volumes: "/var/lib/rabbitmq/"
- name: Running RabbitMQ bootstrap container - name: Running RabbitMQ bootstrap container
kolla_docker: kolla_docker:
@ -29,6 +20,7 @@
BOOTSTRAP: BOOTSTRAP:
name: "rabbitmq_bootstrap" name: "rabbitmq_bootstrap"
restart_policy: "never" restart_policy: "never"
volumes: "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro" volumes:
volumes_from: "rabbitmq_data" - "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
when: exists.rc != 0 - "rabbitmq:/var/lib/rabbitmq/"
when: rabbitmq_volume | changed

View File

@ -5,5 +5,6 @@
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ rabbitmq_image_full }}" image: "{{ rabbitmq_image_full }}"
name: "rabbitmq" name: "rabbitmq"
volumes: "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro" volumes:
volumes_from: "rabbitmq_data" - "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
- "rabbitmq:/var/lib/rabbitmq/"