Deploy etcd in compute nodes when kuryr

Kuryr need etcd on each compute node to store
network data.
Etcd is only deployed in controller nodes at this moment.

Also this change remove and useless bootstrap tasks.

Depends-On: I9c6c876773288c2f951966498db0ff8af090ac20
Change-Id: I8a84334e831fb15f6cbdd3bc34d2159638df6b85
Closes-Bug: #1697699
This commit is contained in:
Eduardo Gonzalez 2017-06-13 16:24:08 +02:00
parent 381c18975c
commit 3958a68fb1
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 }}"