mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +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
@@ -11,7 +11,7 @@
|
||||
- name: check_pull_required | Set pull_required if the desired image is not yet loaded
|
||||
set_fact:
|
||||
pull_required: >-
|
||||
{%- if image_reponame | regex_replace('^docker\.io/(library/)?','') in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
|
||||
{%- if image_reponame | regex_replace('^docker\.io/(library/)?', '') in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
|
||||
when: not download_always_pull
|
||||
|
||||
- name: check_pull_required | Check that the local digest sha256 corresponds to the given image tag
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
retries: "{{ download_retries }}"
|
||||
delay: "{{ retry_stagger | default(5) }}"
|
||||
environment: "{{ proxy_env }}"
|
||||
no_log: "{{ not (unsafe_show_logs|bool) }}"
|
||||
no_log: "{{ not (unsafe_show_logs | bool) }}"
|
||||
loop: "{{ download.mirrors | default([download.url]) }}"
|
||||
loop_control:
|
||||
loop_var: mirror
|
||||
@@ -102,7 +102,7 @@
|
||||
retries: "{{ download_retries }}"
|
||||
delay: "{{ retry_stagger | default(5) }}"
|
||||
environment: "{{ proxy_env }}"
|
||||
no_log: "{{ not (unsafe_show_logs|bool) }}"
|
||||
no_log: "{{ not (unsafe_show_logs | bool) }}"
|
||||
|
||||
- name: download_file | Copy file back to ansible host file cache
|
||||
ansible.posix.synchronize:
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
owner: "{{ download.owner | default(omit) }}"
|
||||
mode: "{{ download.mode | default(omit) }}"
|
||||
copy: no
|
||||
extra_opts: "{{ download.unarchive_extra_opts|default(omit) }}"
|
||||
extra_opts: "{{ download.unarchive_extra_opts | default(omit) }}"
|
||||
when:
|
||||
- download.unarchive | default(false)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: download | Prepare working directories and variables
|
||||
import_tasks: prep_download.yml
|
||||
when:
|
||||
- not skip_downloads|default(false)
|
||||
- not skip_downloads | default(false)
|
||||
tags:
|
||||
- download
|
||||
- upload
|
||||
@@ -10,7 +10,7 @@
|
||||
- name: download | Get kubeadm binary and list of required images
|
||||
include_tasks: prep_kubeadm_images.yml
|
||||
when:
|
||||
- not skip_downloads|default(false)
|
||||
- not skip_downloads | default(false)
|
||||
- inventory_hostname in groups['kube_control_plane']
|
||||
tags:
|
||||
- download
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
- name: prep_download | Register docker images info
|
||||
shell: "{{ image_info_command }}" # noqa command-instead-of-shell - image_info_command contains pipe therefore requires shell
|
||||
no_log: "{{ not (unsafe_show_logs|bool) }}"
|
||||
no_log: "{{ not (unsafe_show_logs | bool) }}"
|
||||
register: docker_images
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
dest: "{{ kube_config_dir }}/kubeadm-images.yaml"
|
||||
mode: 0644
|
||||
when:
|
||||
- not skip_kubeadm_images|default(false)
|
||||
- not skip_kubeadm_images | default(false)
|
||||
|
||||
- name: prep_kubeadm_images | Copy kubeadm binary from download dir to system path
|
||||
copy:
|
||||
@@ -36,36 +36,36 @@
|
||||
state: file
|
||||
|
||||
- name: prep_kubeadm_images | Generate list of required images
|
||||
shell: "set -o pipefail && {{ bin_dir }}/kubeadm config images list --config={{ kube_config_dir }}/kubeadm-images.yaml | grep -Ev 'coredns|pause'"
|
||||
shell: "set -o pipefail && {{ bin_dir }}/kubeadm config images list --config={{ kube_config_dir }}/kubeadm-images.yaml | grep -Ev 'coredns | pause'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: kubeadm_images_raw
|
||||
run_once: true
|
||||
changed_when: false
|
||||
when:
|
||||
- not skip_kubeadm_images|default(false)
|
||||
- not skip_kubeadm_images | default(false)
|
||||
|
||||
- name: prep_kubeadm_images | Parse list of images
|
||||
vars:
|
||||
kubeadm_images_list: "{{ kubeadm_images_raw.stdout_lines }}"
|
||||
set_fact:
|
||||
kubeadm_image:
|
||||
key: "kubeadm_{{ (item | regex_replace('^(?:.*\\/)*','')).split(':')[0] }}"
|
||||
key: "kubeadm_{{ (item | regex_replace('^(?:.*\\/)*', '')).split(':')[0] }}"
|
||||
value:
|
||||
enabled: true
|
||||
container: true
|
||||
repo: "{{ item | regex_replace('^(.*):.*$','\\1') }}"
|
||||
tag: "{{ item | regex_replace('^.*:(.*)$','\\1') }}"
|
||||
repo: "{{ item | regex_replace('^(.*):.*$', '\\1') }}"
|
||||
tag: "{{ item | regex_replace('^.*:(.*)$', '\\1') }}"
|
||||
groups: k8s_cluster
|
||||
loop: "{{ kubeadm_images_list | flatten(levels=1) }}"
|
||||
register: kubeadm_images_cooked
|
||||
run_once: true
|
||||
when:
|
||||
- not skip_kubeadm_images|default(false)
|
||||
- not skip_kubeadm_images | default(false)
|
||||
|
||||
- name: prep_kubeadm_images | Convert list of images to dict for later use
|
||||
set_fact:
|
||||
kubeadm_images: "{{ kubeadm_images_cooked.results | map(attribute='ansible_facts.kubeadm_image') | list | items2dict }}"
|
||||
run_once: true
|
||||
when:
|
||||
- not skip_kubeadm_images|default(false)
|
||||
- not skip_kubeadm_images | default(false)
|
||||
|
||||
Reference in New Issue
Block a user