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]
control
compute
[karbor:children]
control

View File

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

View File

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

View File

@ -14,7 +14,7 @@
volumes: "{{ service.volumes }}"
when:
- action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- service.host_in_groups | bool
- config_json.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"
recurse: yes
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}"
- name: Copying over config.json files for services
@ -15,8 +15,8 @@
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
register: etcd_config_jsons
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container
@ -31,8 +31,8 @@
register: check_etcd_containers
when:
- action != "config"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container

View File

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

View File

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