Merge "Remove compute hosts from etcd group"

This commit is contained in:
Zuul 2018-09-23 05:16:28 +00:00 committed by Gerrit Code Review
commit 0c03f6041e
8 changed files with 8 additions and 15 deletions

View File

@ -54,7 +54,6 @@ monitoring
[etcd:children]
control
compute
[kafka:children]
control

View File

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

View File

@ -14,12 +14,11 @@ etcd_services:
ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}"
ETCD_LISTEN_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}"
ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_cluster_token }}"
ETCD_INITIAL_CLUSTER: "{% for host in etcd_hosts %}{{ hostvars[host]['ansible_hostname'] }}={{ internal_protocol }}://{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}"
ETCD_INITIAL_CLUSTER: "{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_hostname'] }}={{ internal_protocol }}://{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}"
ETCD_INITIAL_CLUSTER_STATE: "new"
ETCD_OUT_FILE: "/var/log/kolla/etcd/etcd.log"
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ etcd_image_full }}"
host_in_groups: "{{ inventory_hostname in etcd_hosts }}"
volumes:
- "{{ node_config_directory }}/etcd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
@ -35,6 +34,3 @@ etcd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_nam
etcd_tag: "{{ openstack_release }}"
etcd_image_full: "{{ etcd_image }}:{{ etcd_tag }}"
etcd_dimensions: "{{ default_container_dimensions }}"
# List of hosts running etcd.
etcd_hosts: "{{ groups['control'] }}"

View File

@ -17,6 +17,6 @@
when:
- kolla_action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- inventory_hostname in groups[service.group]
- config_json.changed | bool
or etcd_container.changed | bool

View File

@ -9,7 +9,7 @@
become: true
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
- name: Copying over config.json files for services
@ -21,7 +21,7 @@
register: etcd_config_jsons
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container
@ -40,7 +40,7 @@
when:
- kolla_action != "config"
- item.value.enabled | bool
- item.value.host_in_groups | bool
- inventory_hostname in groups[item.value.group]
with_dict: "{{ etcd_services }}"
notify:
- Restart etcd container

View File

@ -14,7 +14,7 @@
state: stopped
when:
- container_facts['etcd'] is not defined
- inventory_hostname in groups['etcd']
- inventory_hostname in groups[etcd_services.etcd.group]
- name: Checking free port for Etcd Client
wait_for:
@ -25,4 +25,4 @@
state: stopped
when:
- container_facts['etcd'] is not defined
- inventory_hostname in groups['etcd']
- inventory_hostname in groups[etcd_services.etcd.group]

View File

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

View File

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