From 665d0c9d300e0120f87b9a30c5fd8edbd1ecd539 Mon Sep 17 00:00:00 2001 From: SamYaple Date: Sat, 26 Dec 2015 00:16:14 +0000 Subject: [PATCH] Convert heat to kolla_docker Change-Id: If8153a79d6e6784c757dfcca7f66b2e0c1416bd4 Partially-Implements: blueprint kolla-docker-module --- ansible/roles/heat/tasks/bootstrap.yml | 40 ++++--------------- ansible/roles/heat/tasks/start.yml | 54 ++++++-------------------- 2 files changed, 20 insertions(+), 74 deletions(-) diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml index e0ed79efcf..fb23a6c36b 100644 --- a/ansible/roles/heat/tasks/bootstrap.yml +++ b/ansible/roles/heat/tasks/bootstrap.yml @@ -35,22 +35,12 @@ run_once: True delegate_to: "{{ groups['heat-api'][0] }}" -- name: Starting Heat bootstrap container - docker: - tty: True +- name: Running Heat 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_heat - image: "{{ heat_api_image_full }}" - volumes: "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro" - env: + environment: KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" OS_AUTH_URL: "{{ openstack_auth.auth_url }}" @@ -59,23 +49,9 @@ OS_PASSWORD: "{{ openstack_auth.password }}" OS_PROJECT_NAME: "{{ openstack_auth.project_name }}" HEAT_DOMAIN_ADMIN_PASSWORD: "{{ heat_domain_admin_password }}" - run_once: True - delegate_to: "{{ groups['heat-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_heat - register: bootstrap_result - run_once: True - failed_when: bootstrap_result.stdout != "0" - delegate_to: "{{ groups['heat-api'][0] }}" - when: database_created - -- name: Cleaning up Heat boostrap container - docker: - name: bootstrap_heat image: "{{ heat_api_image_full }}" - state: absent + name: "bootstrap_heat" + volumes: "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro" + run_once: True delegate_to: "{{ groups['heat-api'][0] }}" when: database_created diff --git a/ansible/roles/heat/tasks/start.yml b/ansible/roles/heat/tasks/start.yml index fa279c5fd8..29571818e8 100644 --- a/ansible/roles/heat/tasks/start.yml +++ b/ansible/roles/heat/tasks/start.yml @@ -1,63 +1,33 @@ --- - name: Starting heat-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: heat_api + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" image: "{{ heat_api_image_full }}" + name: "heat_api" volumes: - "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro" - "/var/lib/kolla/dev/log:/dev/log" - env: - KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['heat-api'] - name: Starting heat-api-cfn 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: heat_api_cfn + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" image: "{{ heat_api_cfn_image_full }}" + name: "heat_api_cfn" volumes: - "{{ node_config_directory }}/heat-api-cfn/:{{ container_config_directory }}/:ro" - "/var/lib/kolla/dev/log:/dev/log" - env: - KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['heat-api-cfn'] - name: Starting heat-engine 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: heat_engine + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" image: "{{ heat_engine_image_full }}" + name: "heat_engine" volumes: - "{{ node_config_directory }}/heat-engine/:{{ container_config_directory }}/:ro" - "/var/lib/kolla/dev/log:/dev/log" - env: - KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['heat-engine']