fix: fetch a file relative to the playbook

This commit is contained in:
Александр Степченко 2024-04-29 04:07:09 +03:00
parent b7bdcf3293
commit 6497719ba9

View File

@ -37,17 +37,17 @@
dest: kubeadm-join-command dest: kubeadm-join-command
when: kubeadm_init.rc == 0 when: kubeadm_init.rc == 0
- name: fetch join command - name: fetch join command
fetch: ansible.builtin.fetch:
src: kubeadm-join-command src: kubeadm-join-command
dest: kubeadm-join-command dest: tmp/
flat: yes flat: true
when: kubeadm_init.rc == 0 when: kubeadm_init.rc == 0
- name: Join k8s nodes - name: Join k8s nodes
hosts: workers hosts: workers
tasks: tasks:
- name: run kubeadm join - name: run kubeadm join
command: "{{ lookup('file', 'kubeadm-join-command') }}" command: "{{ lookup('file', 'tmp/kubeadm-join-command') }}"
register: kubeadm_join register: kubeadm_join
changed_when: kubeadm_join.rc == 0 changed_when: kubeadm_join.rc == 0
failed_when: kubeadm_join.rc not in [0, 2] failed_when: kubeadm_join.rc not in [0, 2]