Convert Glance to kolla_docker

Change-Id: I1372bdb14818b5a8920e8b0d1483fd481fb83589
Partially-Implements: blueprint kolla-docker-module
This commit is contained in:
SamYaple 2015-12-24 17:59:46 +00:00
parent f770ea41cc
commit 9e5e51dead
2 changed files with 25 additions and 77 deletions

View File

@ -36,41 +36,18 @@
run_once: True
delegate_to: "{{ groups['glance-api'][0] }}"
- name: Starting Glance bootstrap container
docker:
tty: True
- name: Running Glance bootstrap container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
detach: False
net: host
pull: "{{ docker_pull_policy }}"
restart_policy: "no"
state: reloaded
registry: "{{ docker_registry }}"
username: "{{ docker_registry_username }}"
password: "{{ docker_registry_password }}"
insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_glance
image: "{{ glance_api_image_full }}"
volumes: "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro"
env:
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
run_once: True
delegate_to: "{{ groups['glance-api'][0] }}"
when: database_created
# https://github.com/ansible/ansible-modules-core/pull/1031
- name: Waiting for bootstrap container to exit
command: docker wait bootstrap_glance
register: bootstrap_result
run_once: True
delegate_to: "{{ groups['glance-api'][0] }}"
failed_when: bootstrap_result.stdout != "0"
when: database_created
- name: Cleaning up Glance bootstrap container
docker:
name: bootstrap_glance
image: "{{ glance_api_image_full }}"
state: absent
name: "bootstrap_glance"
restart_policy: "never"
volumes: "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro"
run_once: True
delegate_to: "{{ groups['glance-api'][0] }}"
when: database_created

View File

@ -1,60 +1,31 @@
---
- name: Starting Glance data container
docker:
tty: True
net: host
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: glance_data
- name: Starting glance-data container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ glance_data_image_full }}"
name: "glance_data"
volumes: "/var/lib/glance/"
- name: Starting Glance-registry container
docker:
tty: True
net: host
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: glance_registry
- name: Starting glance-registry container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ glance_registry_image_full }}"
name: "glance_registry"
volumes:
- "{{ node_config_directory }}/glance-registry/:{{ container_config_directory }}/:ro"
- "/var/lib/kolla/dev/log:/dev/log"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['glance-registry']
- name: Starting Glance-api container
docker:
tty: True
net: host
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: glance_api
- name: Starting glance-api container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ glance_api_image_full }}"
name: "glance_api"
volumes:
- "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro"
- "/var/lib/kolla/dev/log:/dev/log"
volumes_from:
- glance_data
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
volumes_from: "glance_data"
when: inventory_hostname in groups['glance-api']