From 061d290e53a40e888bbc71c5e03d1b4d1b5e591c Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Thu, 13 Aug 2015 05:07:01 +0000 Subject: [PATCH] Remove bootstrap.yml abstraction for haproxy Change-Id: Ia7328ff96ba22db1b132bfefaa433af9dc666cbf Partially-Implements: blueprint remove-abstraction-ansible --- ansible/roles/haproxy/defaults/main.yml | 25 ++++--------- ansible/roles/haproxy/tasks/start.yml | 47 ++++++++++++++++++------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/ansible/roles/haproxy/defaults/main.yml b/ansible/roles/haproxy/defaults/main.yml index e781743512..1b8c327ada 100755 --- a/ansible/roles/haproxy/defaults/main.yml +++ b/ansible/roles/haproxy/defaults/main.yml @@ -5,23 +5,10 @@ project_name: "haproxy" #################### # Docker #################### -docker_haproxy_registry: "{{ docker_registry ~ '/' if docker_registry else '' }}" -docker_haproxy_namespace: "{{ docker_namespace }}" -kolla_haproxy_base_distro: "{{ kolla_base_distro }}" -kolla_haproxy_install_type: "{{ kolla_install_type }}" -kolla_haproxy_container_name: "haproxy" +keepalived_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-keepalived" +keepalived_tag: "{{ openstack_release }}" +keepalived_image_full: "{{ keepalived_image }}:{{ keepalived_tag }}" -docker_haproxy_image: "{{ docker_haproxy_registry }}{{ docker_haproxy_namespace }}/{{ kolla_haproxy_base_distro }}-{{ kolla_haproxy_install_type }}-{{ kolla_haproxy_container_name }}" -docker_haproxy_tag: "{{ openstack_release }}" -docker_haproxy_image_full: "{{ docker_haproxy_image }}:{{ docker_haproxy_tag }}" - - -docker_keepalived_registry: "{{ docker_registry ~ '/' if docker_registry else '' }}" -docker_keepalived_namespace: "{{ docker_namespace }}" -kolla_keepalived_base_distro: "{{ kolla_base_distro }}" -kolla_keepalived_install_type: "{{ kolla_install_type }}" -kolla_keepalived_container_name: "keepalived" - -docker_keepalived_image: "{{ docker_keepalived_registry }}{{ docker_keepalived_namespace }}/{{ kolla_keepalived_base_distro }}-{{ kolla_keepalived_install_type }}-{{ kolla_keepalived_container_name }}" -docker_keepalived_tag: "{{ openstack_release }}" -docker_keepalived_image_full: "{{ docker_keepalived_image }}:{{ docker_keepalived_tag }}" +haproxy_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-haproxy" +haproxy_tag: "{{ openstack_release }}" +haproxy_image_full: "{{ haproxy_image }}:{{ haproxy_tag }}" diff --git a/ansible/roles/haproxy/tasks/start.yml b/ansible/roles/haproxy/tasks/start.yml index ca71509155..caecacaf56 100755 --- a/ansible/roles/haproxy/tasks/start.yml +++ b/ansible/roles/haproxy/tasks/start.yml @@ -1,23 +1,44 @@ --- -- include: ../../start.yml - vars: - container_image: "{{ docker_keepalived_image_full }}" - container_name: "keepalived" - container_privileged: "True" - container_volumes: +- name: Starting keepalived container + docker: + docker_api_version: "{{ docker_api_version }}" + 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: keepalived + image: "{{ keepalived_image_full }}" + privileged: True + volumes: - "{{ node_config_directory }}/keepalived/:/opt/kolla/keepalived/:ro" - "/run:/run" - container_environment: + env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" -- include: ../../start.yml - vars: - container_image: "{{ docker_haproxy_image_full }}" - container_name: "haproxy" - container_volumes: +- name: Starting HAProxy container + docker: + docker_api_version: "{{ docker_api_version }}" + 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: haproxy + image: "{{ haproxy_image_full }}" + privileged: True + volumes: - "{{ node_config_directory }}/haproxy/:/opt/kolla/haproxy/:ro" - "/run:/run" - container_environment: + env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" - name: Ensuring latest haproxy config is used