Remove compute hosts from etcd group
Since I701d495675178c3ed8ec1f00b31d09f198b38a6f merged, etcd only runs on the control hosts, not the compute hosts. We therefore no longer require the etcd group to include the compute hosts. Since the group mapping is now static, we can remove the use of host_in_groups from the etcd service, in favour of the simpler method of specifying the group. Change-Id: Id8f888d7321a30a85ff95e742f7e6c8e2b9c696f Related-Bug: #1790415
This commit is contained in:
parent
4dcb4ce741
commit
ee7a29cf00
@ -54,7 +54,6 @@ monitoring
|
|||||||
|
|
||||||
[etcd:children]
|
[etcd:children]
|
||||||
control
|
control
|
||||||
compute
|
|
||||||
|
|
||||||
[kafka:children]
|
[kafka:children]
|
||||||
control
|
control
|
||||||
|
@ -73,7 +73,6 @@ monitoring
|
|||||||
|
|
||||||
[etcd:children]
|
[etcd:children]
|
||||||
control
|
control
|
||||||
compute
|
|
||||||
|
|
||||||
[influxdb:children]
|
[influxdb:children]
|
||||||
monitoring
|
monitoring
|
||||||
|
@ -14,12 +14,11 @@ etcd_services:
|
|||||||
ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}"
|
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_LISTEN_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}"
|
||||||
ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_cluster_token }}"
|
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_INITIAL_CLUSTER_STATE: "new"
|
||||||
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 etcd_hosts }}"
|
|
||||||
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"
|
||||||
@ -35,6 +34,3 @@ etcd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_nam
|
|||||||
etcd_tag: "{{ openstack_release }}"
|
etcd_tag: "{{ openstack_release }}"
|
||||||
etcd_image_full: "{{ etcd_image }}:{{ etcd_tag }}"
|
etcd_image_full: "{{ etcd_image }}:{{ etcd_tag }}"
|
||||||
etcd_dimensions: "{{ default_container_dimensions }}"
|
etcd_dimensions: "{{ default_container_dimensions }}"
|
||||||
|
|
||||||
# List of hosts running etcd.
|
|
||||||
etcd_hosts: "{{ groups['control'] }}"
|
|
||||||
|
@ -17,6 +17,6 @@
|
|||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- service.enabled | bool
|
- service.enabled | bool
|
||||||
- service.host_in_groups | bool
|
- inventory_hostname in groups[service.group]
|
||||||
- config_json.changed | bool
|
- config_json.changed | bool
|
||||||
or etcd_container.changed | bool
|
or etcd_container.changed | bool
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
become: true
|
become: true
|
||||||
when:
|
when:
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- item.value.host_in_groups | bool
|
- inventory_hostname in groups[item.value.group]
|
||||||
with_dict: "{{ etcd_services }}"
|
with_dict: "{{ etcd_services }}"
|
||||||
|
|
||||||
- name: Copying over config.json files for services
|
- name: Copying over config.json files for services
|
||||||
@ -21,7 +21,7 @@
|
|||||||
register: etcd_config_jsons
|
register: etcd_config_jsons
|
||||||
when:
|
when:
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- item.value.host_in_groups | bool
|
- inventory_hostname in groups[item.value.group]
|
||||||
with_dict: "{{ etcd_services }}"
|
with_dict: "{{ etcd_services }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart etcd container
|
- Restart etcd container
|
||||||
@ -40,7 +40,7 @@
|
|||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- item.value.host_in_groups | bool
|
- inventory_hostname in groups[item.value.group]
|
||||||
with_dict: "{{ etcd_services }}"
|
with_dict: "{{ etcd_services }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart etcd container
|
- Restart etcd container
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
state: stopped
|
state: stopped
|
||||||
when:
|
when:
|
||||||
- container_facts['etcd'] is not defined
|
- 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
|
- name: Checking free port for Etcd Client
|
||||||
wait_for:
|
wait_for:
|
||||||
@ -25,4 +25,4 @@
|
|||||||
state: stopped
|
state: stopped
|
||||||
when:
|
when:
|
||||||
- container_facts['etcd'] is not defined
|
- container_facts['etcd'] is not defined
|
||||||
- inventory_hostname in groups['etcd']
|
- inventory_hostname in groups[etcd_services.etcd.group]
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
image: "{{ item.value.image }}"
|
image: "{{ item.value.image }}"
|
||||||
when:
|
when:
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- item.value.host_in_groups | bool
|
- inventory_hostname in groups[item.value.group]
|
||||||
with_dict: "{{ etcd_services }}"
|
with_dict: "{{ etcd_services }}"
|
||||||
|
@ -52,7 +52,6 @@ monitoring
|
|||||||
|
|
||||||
[etcd:children]
|
[etcd:children]
|
||||||
control
|
control
|
||||||
compute
|
|
||||||
|
|
||||||
[karbor:children]
|
[karbor:children]
|
||||||
control
|
control
|
||||||
|
Loading…
Reference in New Issue
Block a user