mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-17 19:20:10 -03:30
Fix Ansible-lint error [E502] (#4743)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
13f225e6ae
commit
73c2ff17dd
@@ -1,11 +1,13 @@
|
||||
---
|
||||
- set_fact:
|
||||
- name: set bastion host IP
|
||||
set_fact:
|
||||
bastion_ip: "{{ hostvars[groups['bastion'][0]]['ansible_host'] | d(hostvars[groups['bastion'][0]]['ansible_ssh_host']) }}"
|
||||
delegate_to: localhost
|
||||
|
||||
# As we are actually running on localhost, the ansible_ssh_user is your local user when you try to use it directly
|
||||
# To figure out the real ssh user, we delegate this task to the bastion and store the ansible_user in real_user
|
||||
- set_fact:
|
||||
- name: Store the current ansible_user in the real_user fact
|
||||
set_fact:
|
||||
real_user: "{{ ansible_user }}"
|
||||
|
||||
- name: create ssh bastion conf
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
path: /run/ostree-booted
|
||||
register: ostree
|
||||
|
||||
- set_fact:
|
||||
- name: set is_atomic
|
||||
set_fact:
|
||||
is_atomic: "{{ ostree.stat.exists }}"
|
||||
|
||||
- name: gather os specific variables
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
when: download_run_once
|
||||
changed_when: false
|
||||
|
||||
- vars:
|
||||
- name: container_download | extract container names from list of kubeadm config images
|
||||
vars:
|
||||
kubeadm_images_list: "{{ result.stdout_lines }}"
|
||||
set_fact:
|
||||
kubeadm_image:
|
||||
@@ -66,7 +67,8 @@
|
||||
when: download_run_once
|
||||
register: result_images
|
||||
|
||||
- set_fact:
|
||||
- name: container_download | set kubeadm_images
|
||||
set_fact:
|
||||
kubeadm_images: "{{ result_images.results | map(attribute='ansible_facts.kubeadm_image') | list | items2dict }}"
|
||||
run_once: true
|
||||
when: download_run_once
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
- not skip_downloads|default(false)
|
||||
- inventory_hostname in groups['kube-master']
|
||||
|
||||
- set_fact:
|
||||
- name: Set kubeadm_images
|
||||
set_fact:
|
||||
kubeadm_images: {}
|
||||
when:
|
||||
- kubeadm_images is not defined
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
---
|
||||
- set_fact:
|
||||
- name: Set if containers should be pulled by digest
|
||||
set_fact:
|
||||
pull_by_digest: >-
|
||||
{%- if download.sha256 is defined and download.sha256 -%}true{%- else -%}false{%- endif -%}
|
||||
|
||||
- set_fact:
|
||||
- name: Set pull_args
|
||||
set_fact:
|
||||
pull_args: >-
|
||||
{%- if pull_by_digest %}{{ download.repo }}@sha256:{{ download.sha256 }}{%- else -%}{{ download.repo }}:{{ download.tag }}{%- endif -%}
|
||||
|
||||
@@ -19,7 +21,8 @@
|
||||
- not download_always_pull
|
||||
- group_names | intersect(download.groups) | length
|
||||
|
||||
- set_fact:
|
||||
- name: Set if pull is required per container
|
||||
set_fact:
|
||||
pull_required: >-
|
||||
{%- if pull_args in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
|
||||
when:
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
tags:
|
||||
- facts
|
||||
|
||||
- set_fact:
|
||||
- name: container_download | Set file name of container tarballs
|
||||
set_fact:
|
||||
fname: "{{ local_release_dir }}/containers/{{ download.repo|regex_replace('/|\0|:', '_') }}:{{ download.tag|default(download.sha256)|regex_replace('/|\0|:', '_') }}.tar"
|
||||
run_once: true
|
||||
when:
|
||||
- download.enabled
|
||||
- download.container
|
||||
- download_run_once
|
||||
|
||||
tags:
|
||||
- facts
|
||||
|
||||
|
||||
@@ -109,7 +109,8 @@
|
||||
loop_control:
|
||||
label: "{{ item.item }}"
|
||||
|
||||
- set_fact:
|
||||
- name: Gen_certs | Set cert names per node
|
||||
set_fact:
|
||||
my_etcd_node_certs: ['ca.pem',
|
||||
'node-{{ inventory_hostname }}.pem',
|
||||
'node-{{ inventory_hostname }}-key.pem']
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- set_fact:
|
||||
- name: set architecture_groups
|
||||
set_fact:
|
||||
architecture_groups:
|
||||
x86_64: amd64
|
||||
aarch64: arm64
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
delegate_to: "{{ groups['kube-master'][0] }}"
|
||||
command: "{{ helm_script_dir }}/helm-make-ssl.sh -e {{ helm_home_dir }} -d {{ helm_tiller_cert_dir }}"
|
||||
|
||||
- set_fact:
|
||||
- name: Check_helm_client_certs | Set helm_client_certs
|
||||
set_fact:
|
||||
helm_client_certs: ['ca.pem', 'cert.pem', 'key.pem']
|
||||
|
||||
- name: "Check_helm_client_certs | check if a cert already exists on master node"
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
run_once: true
|
||||
changed_when: false
|
||||
|
||||
- set_fact:
|
||||
- name: Contiv | Set contiv_global_config
|
||||
set_fact:
|
||||
contiv_global_config: "{{ (global_config.stdout|from_json)[0] }}"
|
||||
|
||||
- name: Contiv | Set global forwarding mode
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
register: docker_cgroup_driver_result
|
||||
changed_when: false
|
||||
|
||||
- set_fact:
|
||||
- name: set facts
|
||||
set_fact:
|
||||
standalone_kubelet: >-
|
||||
{%- if inventory_hostname in groups['kube-master'] and inventory_hostname not in groups['kube-node'] -%}true{%- else -%}false{%- endif -%}
|
||||
kubelet_cgroup_driver_detected: "{{ docker_cgroup_driver_result.stdout }}"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
- set_fact:
|
||||
- name: set architecture_groups
|
||||
set_fact:
|
||||
architecture_groups:
|
||||
x86_64: amd64
|
||||
aarch64: arm64
|
||||
@@ -25,10 +26,12 @@
|
||||
path: /run/ostree-booted
|
||||
register: ostree
|
||||
|
||||
- set_fact:
|
||||
- name: set is_atomic
|
||||
set_fact:
|
||||
is_atomic: "{{ ostree.stat.exists }}"
|
||||
|
||||
- set_fact:
|
||||
- name: set kube_cert_group on atomic hosts
|
||||
set_fact:
|
||||
kube_cert_group: "kube"
|
||||
when: is_atomic
|
||||
|
||||
@@ -39,11 +42,10 @@
|
||||
changed_when: false
|
||||
check_mode: no
|
||||
|
||||
- set_fact:
|
||||
- name: set dns facts
|
||||
set_fact:
|
||||
resolvconf: >-
|
||||
{%- if resolvconf.rc == 0 -%}true{%- else -%}false{%- endif -%}
|
||||
|
||||
- set_fact:
|
||||
bogus_domains: |-
|
||||
{% for d in [ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([]) -%}
|
||||
{{ dns_domain }}.{{ d }}./{{ d }}.{{ d }}./com.{{ d }}./
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
- {name: contiv-netplugin, file: contiv-netplugin.yml, type: daemonset}
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
|
||||
- set_fact:
|
||||
- name: Contiv | Add another manifest if contiv_enable_api_proxy is true
|
||||
set_fact:
|
||||
contiv_manifests: |-
|
||||
{% set _ = contiv_manifests.append({"name": "contiv-api-proxy", "file": "contiv-api-proxy.yml", "type": "daemonset"}) %}
|
||||
{{ contiv_manifests }}
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- set_fact:
|
||||
- name: Set if node needs cordoning
|
||||
set_fact:
|
||||
needs_cordoning: >-
|
||||
{% if kubectl_node_ready.stdout == "True" and not kubectl_node_schedulable.stdout -%}
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user