mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
Only use stat get_checksum: yes when needed (#7270)
By default Ansible stat module compute checksum, list extended attributes and find mime type To find all stat invocations that really use one of those: git grep -F stat. | grep -vE 'stat.(islnk|exists|lnk_source|writeable)' Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
This commit is contained in:
committed by
GitHub
parent
6450207713
commit
de1d9df787
@@ -2,6 +2,9 @@
|
||||
- name: Check if secret for encrypting data at rest already exist
|
||||
stat:
|
||||
path: "{{ kube_cert_dir }}/secrets_encryption.yaml"
|
||||
get_attributes: no
|
||||
get_checksum: no
|
||||
get_mime: no
|
||||
register: secrets_encryption_file
|
||||
|
||||
- name: Slurp secrets_encryption file if it exists
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
- name: kubeadm | Check if old apiserver cert exists on host
|
||||
stat:
|
||||
path: "{{ kube_cert_dir }}/apiserver.pem"
|
||||
get_attributes: no
|
||||
get_checksum: no
|
||||
get_mime: no
|
||||
register: old_apiserver_cert
|
||||
delegate_to: "{{ groups['kube-master'] | first }}"
|
||||
run_once: true
|
||||
@@ -24,12 +27,18 @@
|
||||
- name: kubeadm | Check serviceaccount key
|
||||
stat:
|
||||
path: "{{ kube_cert_dir }}/sa.key"
|
||||
get_attributes: no
|
||||
get_checksum: yes
|
||||
get_mime: no
|
||||
register: sa_key_before
|
||||
run_once: true
|
||||
|
||||
- name: kubeadm | Check if kubeadm has already run
|
||||
stat:
|
||||
path: "/var/lib/kubelet/config.yaml"
|
||||
get_attributes: no
|
||||
get_checksum: no
|
||||
get_mime: no
|
||||
register: kubeadm_already_run
|
||||
|
||||
- name: kubeadm | Delete old admin.conf
|
||||
@@ -211,6 +220,9 @@
|
||||
- name: kubeadm | Check serviceaccount key again
|
||||
stat:
|
||||
path: "{{ kube_cert_dir }}/sa.key"
|
||||
get_attributes: no
|
||||
get_checksum: yes
|
||||
get_mime: no
|
||||
register: sa_key_after
|
||||
run_once: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user