Convert mariadb to kolla_docker

Change-Id: I804665386d5fb806449d2cfac981bc8e08109e0e
Partially-Implements: blueprint kolla-docker-module
This commit is contained in:
SamYaple 2015-12-25 22:39:07 +00:00
parent a84030d66e
commit 63c2f56317
2 changed files with 20 additions and 47 deletions

View File

@ -36,43 +36,27 @@
always_run: True always_run: True
run_once: True run_once: True
- name: Starting MariaDB data container - name: Starting mariadb-data container
docker: kolla_docker:
tty: True action: "start_container"
net: host common_options: "{{ docker_common_options }}"
pull: "{{ docker_pull_policy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_policy_retry: "{{ docker_restart_policy_retry }}"
state: reloaded
registry: "{{ docker_registry }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
insecure_registry: "{{ docker_insecure_registry }}"
name: mariadb_data
image: "{{ mariadb_data_image_full }}" image: "{{ mariadb_data_image_full }}"
name: "mariadb_data"
volumes: "/var/lib/mysql/" volumes: "/var/lib/mysql/"
- name: Starting MariaDB bootstrap container - name: Starting MariaDB bootstrap container
docker: kolla_docker:
tty: True action: "start_container"
net: host common_options: "{{ docker_common_options }}"
pull: "{{ docker_pull_policy }}" environment:
restart_policy: "no"
restart_policy_retry: "{{ docker_restart_policy_retry }}"
state: reloaded
registry: "{{ docker_registry }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
insecure_registry: "{{ docker_insecure_registry }}"
name: mariadb
image: "{{ mariadb_image_full }}"
volumes: "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
volumes_from:
- "mariadb_data"
env:
KOLLA_BOOTSTRAP: KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
DB_ROOT_PASSWORD: "{{ database_password }}" DB_ROOT_PASSWORD: "{{ database_password }}"
image: "{{ mariadb_image_full }}"
name: "mariadb"
restart_policy: "never"
volumes: "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
volumes_from: "mariadb_data"
when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0] when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0]
- name: Sleeping for 15 seconds while the cluster starts - name: Sleeping for 15 seconds while the cluster starts

View File

@ -1,23 +1,12 @@
--- ---
- name: Starting MariaDB container - name: Starting mariadb container
docker: kolla_docker:
tty: True action: "start_container"
net: host common_options: "{{ docker_common_options }}"
pull: "{{ docker_pull_policy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_policy_retry: "{{ docker_restart_policy_retry }}"
state: reloaded
registry: "{{ docker_registry }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
insecure_registry: "{{ docker_insecure_registry }}"
name: mariadb
image: "{{ mariadb_image_full }}" image: "{{ mariadb_image_full }}"
name: "mariadb"
volumes: "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro" volumes: "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
volumes_from: volumes_from: "mariadb_data"
- "mariadb_data"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: delegate_host != 'None' or when: delegate_host != 'None' or
( groups['mariadb'] | length ) == 1 or ( groups['mariadb'] | length ) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] ) ( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )