Merge "Deploy etcd in compute nodes when kuryr"

This commit is contained in:
Jenkins 2017-06-30 14:06:17 +00:00 committed by Gerrit Code Review
commit 3a765500ce
8 changed files with 12 additions and 26 deletions

View File

@ -40,6 +40,7 @@ monitoring
[etcd:children] [etcd:children]
control control
compute
[karbor:children] [karbor:children]
control control

View File

@ -58,6 +58,7 @@ monitoring
[etcd:children] [etcd:children]
control control
compute
[influxdb:children] [influxdb:children]
monitoring monitoring

View File

@ -19,6 +19,11 @@ etcd_services:
ETCD_OUT_FILE: "/var/log/kolla/etcd/etcd.log" ETCD_OUT_FILE: "/var/log/kolla/etcd/etcd.log"
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ etcd_image_full }}" image: "{{ etcd_image_full }}"
host_in_groups: >-
{{
inventory_hostname in groups['control']
or (enable_kuryr | bool and inventory_hostname in groups['compute'])
}}
volumes: volumes:
- "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -14,7 +14,7 @@
volumes: "{{ service.volumes }}" volumes: "{{ service.volumes }}"
when: when:
- action != "config" - action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool - service.enabled | bool
- service.host_in_groups | bool
- config_json.changed | bool - config_json.changed | bool
or etcd_container.changed | bool or etcd_container.changed | bool

View File

@ -1,19 +0,0 @@
---
- name: Running etcd bootstrap container
vars:
etcd: "{{ etcd_services['etcd'] }}"
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
detach: False
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ etcd.image }}"
labels:
BOOTSTRAP:
name: "bootstrap_etcd"
restart_policy: "never"
volumes: "{{ etcd.volumes }}"
run_once: True
delegate_to: "{{ groups[etcd.group][0] }}"

View File

@ -5,8 +5,8 @@
state: "directory" state: "directory"
recurse: yes recurse: yes
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}" with_dict: "{{ etcd_services }}"
- name: Copying over config.json files for services - name: Copying over config.json files for services
@ -15,8 +15,8 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json" dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
register: etcd_config_jsons register: etcd_config_jsons
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}" with_dict: "{{ etcd_services }}"
notify: notify:
- Restart etcd container - Restart etcd container
@ -31,8 +31,8 @@
register: check_etcd_containers register: check_etcd_containers
when: when:
- action != "config" - action != "config"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}" with_dict: "{{ etcd_services }}"
notify: notify:
- Restart etcd container - Restart etcd container

View File

@ -1,7 +1,5 @@
--- ---
- include: config.yml - include: config.yml
- include: bootstrap.yml
- name: Flush handlers - name: Flush handlers
meta: flush_handlers meta: flush_handlers

View File

@ -5,6 +5,6 @@
common_options: "{{ docker_common_options }}" common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
when: when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}" with_dict: "{{ etcd_services }}"