mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2025-12-25 00:12:37 +01:00
Introduce copy of k3s.yaml file to detect changes and skip control node changes (#347)
Signed-off-by: Peter Klijn <pjmklijn@gmail.com>
This commit is contained in:
@@ -117,8 +117,20 @@
|
|||||||
become: false
|
become: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
# Copy the k3s config to a second file to detect changes.
|
||||||
|
# If no changes are found, we can skip copying the kubeconfig to the control node.
|
||||||
|
- name: Copy k3s.yaml to second file
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: /etc/rancher/k3s/k3s.yaml
|
||||||
|
dest: /etc/rancher/k3s/k3s-copy.yaml
|
||||||
|
mode: "0600"
|
||||||
|
remote_src: true
|
||||||
|
register: copy_k3s_yaml_file
|
||||||
|
|
||||||
- name: Apply K3S kubeconfig to control node
|
- name: Apply K3S kubeconfig to control node
|
||||||
when: kubectl_installed.rc == 0
|
when:
|
||||||
|
- kubectl_installed.rc == 0
|
||||||
|
- copy_k3s_yaml_file.changed
|
||||||
block:
|
block:
|
||||||
- name: Copy kubeconfig to control node
|
- name: Copy kubeconfig to control node
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
|
|||||||
Reference in New Issue
Block a user