mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-15 22:34:21 +03:00
project: fix var-spacing ansible rule (#10266)
* project: fix var-spacing ansible rule Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing on the beginning/end of jinja template Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing of default filter Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing between filter arguments Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix double space at beginning/end of jinja Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix remaining jinja[spacing] ansible-lint warning Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
This commit is contained in:
committed by
GitHub
parent
f8b93fa88a
commit
5d00b851ce
@@ -21,7 +21,7 @@ kube_version: v1.26.6
|
||||
## The minimum version working
|
||||
kube_version_min_required: v1.25.0
|
||||
|
||||
## Kube Proxy mode One of ['iptables','ipvs']
|
||||
## Kube Proxy mode One of ['iptables', 'ipvs']
|
||||
kube_proxy_mode: ipvs
|
||||
|
||||
## The timeout for init first control-plane
|
||||
@@ -33,13 +33,13 @@ kubeadm_init_timeout: 300s
|
||||
kubeadm_init_phases_skip_default: [ "addon/coredns" ]
|
||||
kubeadm_init_phases_skip: >-
|
||||
{%- if kube_network_plugin == 'kube-router' and (kube_router_run_service_proxy is defined and kube_router_run_service_proxy) -%}
|
||||
{{ kubeadm_init_phases_skip_default + [ "addon/kube-proxy" ] }}
|
||||
{{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
|
||||
{%- elif kube_network_plugin == 'cilium' and (cilium_kube_proxy_replacement is defined and cilium_kube_proxy_replacement == 'strict') -%}
|
||||
{{ kubeadm_init_phases_skip_default + [ "addon/kube-proxy" ] }}
|
||||
{{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
|
||||
{%- elif kube_network_plugin == 'calico' and (calico_bpf_enabled is defined and calico_bpf_enabled) -%}
|
||||
{{ kubeadm_init_phases_skip_default + [ "addon/kube-proxy" ] }}
|
||||
{{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
|
||||
{%- elif kube_proxy_remove is defined and kube_proxy_remove -%}
|
||||
{{ kubeadm_init_phases_skip_default + [ "addon/kube-proxy" ] }}
|
||||
{{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
|
||||
{%- else -%}
|
||||
{{ kubeadm_init_phases_skip_default }}
|
||||
{%- endif -%}
|
||||
@@ -116,19 +116,19 @@ resolvconf_mode: host_resolvconf
|
||||
# Deploy netchecker app to verify DNS resolve as an HTTP service
|
||||
deploy_netchecker: false
|
||||
# Ip address of the kubernetes DNS service (called skydns for historical reasons)
|
||||
skydns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(3)|ipaddr('address') }}"
|
||||
skydns_server_secondary: "{{ kube_service_addresses|ipaddr('net')|ipaddr(4)|ipaddr('address') }}"
|
||||
skydns_server: "{{ kube_service_addresses | ipaddr('net') | ipaddr(3) | ipaddr('address') }}"
|
||||
skydns_server_secondary: "{{ kube_service_addresses | ipaddr('net') | ipaddr(4) | ipaddr('address') }}"
|
||||
dns_domain: "{{ cluster_name }}"
|
||||
docker_dns_search_domains:
|
||||
- 'default.svc.{{ dns_domain }}'
|
||||
- 'svc.{{ dns_domain }}'
|
||||
|
||||
kube_dns_servers:
|
||||
coredns: ["{{skydns_server}}"]
|
||||
coredns_dual: "{{[skydns_server] + [ skydns_server_secondary ]}}"
|
||||
manual: ["{{manual_dns_server}}"]
|
||||
coredns: ["{{ skydns_server }}"]
|
||||
coredns_dual: "{{ [skydns_server] + [skydns_server_secondary] }}"
|
||||
manual: ["{{ manual_dns_server }}"]
|
||||
|
||||
dns_servers: "{{kube_dns_servers[dns_mode]}}"
|
||||
dns_servers: "{{ kube_dns_servers[dns_mode] }}"
|
||||
|
||||
enable_coredns_k8s_external: false
|
||||
coredns_k8s_external_zone: k8s_external.local
|
||||
@@ -179,7 +179,7 @@ kube_network_plugin: calico
|
||||
kube_network_plugin_multus: false
|
||||
|
||||
# Determines if calico_rr group exists
|
||||
peer_with_calico_rr: "{{ 'calico_rr' in groups and groups['calico_rr']|length > 0 }}"
|
||||
peer_with_calico_rr: "{{ 'calico_rr' in groups and groups['calico_rr'] | length > 0 }}"
|
||||
|
||||
# Choose data store type for calico: "etcd" or "kdd" (kubernetes datastore)
|
||||
calico_datastore: "kdd"
|
||||
@@ -232,10 +232,10 @@ kube_network_node_prefix_ipv6: 120
|
||||
# listening on.
|
||||
# NOTE: loadbalancer_apiserver_localhost somewhat alters the final API enpdoint
|
||||
# access IP value (automatically evaluated below)
|
||||
kube_apiserver_ip: "{{ kube_service_addresses|ipaddr('net')|ipaddr(1)|ipaddr('address') }}"
|
||||
kube_apiserver_ip: "{{ kube_service_addresses | ipaddr('net') | ipaddr(1) | ipaddr('address') }}"
|
||||
|
||||
# NOTE: If you specific address/interface and use loadbalancer_apiserver_localhost
|
||||
# loadbalancer_apiserver_localhost (nginx/haproxy) will deploy on masters on 127.0.0.1:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }} too.
|
||||
# loadbalancer_apiserver_localhost (nginx/haproxy) will deploy on masters on 127.0.0.1:{{ loadbalancer_apiserver_port | default(kube_apiserver_port) }} too.
|
||||
kube_apiserver_bind_address: 0.0.0.0
|
||||
|
||||
# https
|
||||
@@ -243,7 +243,7 @@ kube_apiserver_port: 6443
|
||||
|
||||
# If non-empty, will use this string as identification instead of the actual hostname
|
||||
kube_override_hostname: >-
|
||||
{%- if cloud_provider is defined and cloud_provider in [ 'aws' ] -%}
|
||||
{%- if cloud_provider is defined and cloud_provider in ['aws'] -%}
|
||||
{%- else -%}
|
||||
{{ inventory_hostname }}
|
||||
{%- endif -%}
|
||||
@@ -443,7 +443,7 @@ openstack_lbaas_create_monitor: "yes"
|
||||
openstack_lbaas_monitor_delay: "1m"
|
||||
openstack_lbaas_monitor_timeout: "30s"
|
||||
openstack_lbaas_monitor_max_retries: "3"
|
||||
openstack_cacert: "{{ lookup('env','OS_CACERT') }}"
|
||||
openstack_cacert: "{{ lookup('env', 'OS_CACERT') }}"
|
||||
|
||||
# Default values for the external OpenStack Cloud Controller
|
||||
external_openstack_lbaas_enabled: true
|
||||
@@ -509,7 +509,7 @@ kubeadm_feature_gates: []
|
||||
local_volume_provisioner_storage_classes: |
|
||||
{
|
||||
"{{ local_volume_provisioner_storage_class | default('local-storage') }}": {
|
||||
"host_dir": "{{ local_volume_provisioner_base_dir | default ('/mnt/disks') }}",
|
||||
"host_dir": "{{ local_volume_provisioner_base_dir | default('/mnt/disks') }}",
|
||||
"mount_dir": "{{ local_volume_provisioner_mount_dir | default('/mnt/disks') }}",
|
||||
"volume_mode": "Filesystem",
|
||||
"fs_type": "ext4"
|
||||
@@ -546,7 +546,7 @@ loadbalancer_apiserver_type: "nginx"
|
||||
apiserver_loadbalancer_domain_name: "lb-apiserver.kubernetes.local"
|
||||
kube_apiserver_global_endpoint: |-
|
||||
{% if loadbalancer_apiserver is defined -%}
|
||||
https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port|default(kube_apiserver_port) }}
|
||||
https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||
{%- elif loadbalancer_apiserver_localhost and (loadbalancer_apiserver_port is not defined or loadbalancer_apiserver_port == kube_apiserver_port) -%}
|
||||
https://localhost:{{ kube_apiserver_port }}
|
||||
{%- else -%}
|
||||
@@ -554,11 +554,11 @@ kube_apiserver_global_endpoint: |-
|
||||
{%- endif %}
|
||||
kube_apiserver_endpoint: |-
|
||||
{% if loadbalancer_apiserver is defined -%}
|
||||
https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port|default(kube_apiserver_port) }}
|
||||
https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
|
||||
{%- elif not is_kube_master and loadbalancer_apiserver_localhost -%}
|
||||
https://localhost:{{ loadbalancer_apiserver_port|default(kube_apiserver_port) }}
|
||||
https://localhost:{{ loadbalancer_apiserver_port | default(kube_apiserver_port) }}
|
||||
{%- elif is_kube_master -%}
|
||||
https://{{ kube_apiserver_bind_address | regex_replace('0\.0\.0\.0','127.0.0.1') }}:{{ kube_apiserver_port }}
|
||||
https://{{ kube_apiserver_bind_address | regex_replace('0\.0\.0\.0', '127.0.0.1') }}:{{ kube_apiserver_port }}
|
||||
{%- else -%}
|
||||
https://{{ first_kube_control_plane_address }}:{{ kube_apiserver_port }}
|
||||
{%- endif %}
|
||||
@@ -594,20 +594,20 @@ etcd_metrics_addresses: |-
|
||||
{% for item in etcd_hosts -%}
|
||||
https://{{ hostvars[item]['etcd_access_address'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:{{ etcd_metrics_port | default(2381) }}{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
etcd_events_access_addresses: "{{etcd_events_access_addresses_list | join(',')}}"
|
||||
etcd_events_access_addresses_semicolon: "{{etcd_events_access_addresses_list | join(';')}}"
|
||||
etcd_events_access_addresses: "{{ etcd_events_access_addresses_list | join(',') }}"
|
||||
etcd_events_access_addresses_semicolon: "{{ etcd_events_access_addresses_list | join(';') }}"
|
||||
# user should set etcd_member_name in inventory/mycluster/hosts.ini
|
||||
etcd_member_name: |-
|
||||
{% for host in groups['etcd'] %}
|
||||
{% if inventory_hostname == host %}{{ hostvars[host].etcd_member_name | default("etcd" + loop.index|string) }}{% endif %}
|
||||
{% if inventory_hostname == host %}{{ hostvars[host].etcd_member_name | default("etcd" + loop.index | string) }}{% endif %}
|
||||
{% endfor %}
|
||||
etcd_peer_addresses: |-
|
||||
{% for item in groups['etcd'] -%}
|
||||
{{ hostvars[item].etcd_member_name | default("etcd" + loop.index|string) }}=https://{{ hostvars[item].etcd_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2380{% if not loop.last %},{% endif %}
|
||||
{{ hostvars[item].etcd_member_name | default("etcd" + loop.index | string) }}=https://{{ hostvars[item].etcd_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2380{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
etcd_events_peer_addresses: |-
|
||||
{% for item in groups['etcd'] -%}
|
||||
{{ hostvars[item].etcd_member_name | default("etcd" + loop.index|string) }}-events=https://{{ hostvars[item].etcd_events_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2382{% if not loop.last %},{% endif %}
|
||||
{{ hostvars[item].etcd_member_name | default("etcd" + loop.index | string) }}-events=https://{{ hostvars[item].etcd_events_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2382{% if not loop.last %},{% endif %}
|
||||
{%- endfor %}
|
||||
|
||||
podsecuritypolicy_enabled: false
|
||||
@@ -653,16 +653,16 @@ host_os: >-
|
||||
kubelet_event_record_qps: 5
|
||||
|
||||
proxy_env_defaults:
|
||||
http_proxy: "{{ http_proxy | default ('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy | default ('') }}"
|
||||
https_proxy: "{{ https_proxy | default ('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
|
||||
no_proxy: "{{ no_proxy | default ('') }}"
|
||||
NO_PROXY: "{{ no_proxy | default ('') }}"
|
||||
http_proxy: "{{ http_proxy | default('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy | default('') }}"
|
||||
https_proxy: "{{ https_proxy | default('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy | default('') }}"
|
||||
no_proxy: "{{ no_proxy | default('') }}"
|
||||
NO_PROXY: "{{ no_proxy | default('') }}"
|
||||
|
||||
# If we use SSL_CERT_FILE: {{ omit }} it cause in value __omit_place_holder__ and break environments
|
||||
# Combine dict is avoiding the problem with omit placeholder. Maybe it can be better solution?
|
||||
proxy_env: "{{ proxy_env_defaults | combine({ 'SSL_CERT_FILE': https_proxy_cert_file }) if https_proxy_cert_file is defined else proxy_env_defaults }}"
|
||||
proxy_env: "{{ proxy_env_defaults | combine({'SSL_CERT_FILE': https_proxy_cert_file}) if https_proxy_cert_file is defined else proxy_env_defaults }}"
|
||||
|
||||
proxy_disable_env:
|
||||
ALL_PROXY: ''
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
delegate_to: "{{ item }}"
|
||||
delegate_facts: yes
|
||||
when: hostvars[item].ansible_default_ipv4 is not defined
|
||||
loop: "{{ (groups['k8s_cluster']|default([]) + groups['etcd']|default([]) + groups['calico_rr']|default([])) | unique }}"
|
||||
loop: "{{ (groups['k8s_cluster'] | default([]) + groups['etcd'] | default([]) + groups['calico_rr'] | default([])) | unique }}"
|
||||
run_once: yes
|
||||
tags: always
|
||||
|
||||
@@ -18,7 +18,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 %}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
- name: Set no_proxy to all assigned cluster IPs and hostnames
|
||||
set_fact:
|
||||
# noqa: jinja[spacing]
|
||||
no_proxy_prepare: >-
|
||||
{%- if loadbalancer_apiserver is defined -%}
|
||||
{{ apiserver_loadbalancer_domain_name| default('') }},
|
||||
{{ apiserver_loadbalancer_domain_name | default('') }},
|
||||
{{ loadbalancer_apiserver.address | default('') }},
|
||||
{%- endif -%}
|
||||
{%- if no_proxy_exclude_workers | default(false) -%}
|
||||
@@ -11,12 +12,12 @@
|
||||
{%- else -%}
|
||||
{% 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', '') -%}
|
||||
{%- if item != hostvars[item].get('ansible_hostname', '') -%}
|
||||
{{ hostvars[item]['ansible_hostname'] }},
|
||||
{{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }},
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{{ item }},{{ item }}.{{ dns_domain }},
|
||||
{%- endfor -%}
|
||||
{%- if additional_no_proxy is defined -%}
|
||||
@@ -32,7 +33,8 @@
|
||||
- name: Populates no_proxy to all hosts
|
||||
set_fact:
|
||||
no_proxy: "{{ hostvars.localhost.no_proxy_prepare }}"
|
||||
# noqa: jinja[spacing]
|
||||
proxy_env: "{{ proxy_env | combine({
|
||||
'no_proxy': hostvars.localhost.no_proxy_prepare,
|
||||
'NO_PROXY': hostvars.localhost.no_proxy_prepare
|
||||
}) }}"
|
||||
'no_proxy': hostvars.localhost.no_proxy_prepare,
|
||||
'NO_PROXY': hostvars.localhost.no_proxy_prepare
|
||||
}) }}"
|
||||
|
||||
Reference in New Issue
Block a user