mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-14 12:57:45 -02:30
Rename ansible groups to use _ instead of - (#7552)
* rename ansible groups to use _ instead of -
k8s-cluster -> k8s_cluster
k8s-node -> k8s_node
calico-rr -> calico_rr
no-floating -> no_floating
Note: kube-node,k8s-cluster groups in upgrade CI
need clean-up after v2.16 is tagged
* ensure old groups are mapped to the new ones
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
tags: always
|
||||
include_tasks: fallback_ips_gather.yml
|
||||
when: hostvars[delegate_host_to_gather_facts].ansible_default_ipv4 is not defined
|
||||
loop: "{{ groups['k8s-cluster']|default([]) + groups['etcd']|default([]) + groups['calico-rr']|default([]) }}"
|
||||
loop: "{{ groups['k8s_cluster']|default([]) + groups['etcd']|default([]) + groups['calico_rr']|default([]) }}"
|
||||
loop_control:
|
||||
loop_var: delegate_host_to_gather_facts
|
||||
run_once: yes
|
||||
@@ -16,7 +16,7 @@
|
||||
set_fact:
|
||||
fallback_ips_base: |
|
||||
---
|
||||
{% for item in (groups['k8s-cluster']|default([]) + groups['etcd']|default([]) + groups['calico-rr']|default([]))|unique %}
|
||||
{% for item in (groups['k8s_cluster']|default([]) + groups['etcd']|default([]) + groups['calico_rr']|default([]))|unique %}
|
||||
{% set found = hostvars[item].get('ansible_default_ipv4') %}
|
||||
{{ item }}: "{{ found.get('address', '127.0.0.1') }}"
|
||||
{% endfor %}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
{%- if no_proxy_exclude_workers | default(false) -%}
|
||||
{% set cluster_or_master = 'kube_control_plane' %}
|
||||
{%- else -%}
|
||||
{% set cluster_or_master = 'k8s-cluster' %}
|
||||
{% set cluster_or_master = 'k8s_cluster' %}
|
||||
{%- endif -%}
|
||||
{%- for item in (groups[cluster_or_master] + groups['etcd']|default([]) + groups['calico-rr']|default([]))|unique -%}
|
||||
{%- for item in (groups[cluster_or_master] + groups['etcd']|default([]) + groups['calico_rr']|default([]))|unique -%}
|
||||
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }},
|
||||
{%- if item != hostvars[item].get('ansible_hostname', '') -%}
|
||||
{{ hostvars[item]['ansible_hostname'] }},
|
||||
|
||||
Reference in New Issue
Block a user