Answer the question
In order to leave comments, you need to log in
How to create kubeadm token with ansible?
Good afternoon!
I'm trying to fire kubeadm token through ansible, googling I found a bunch of similar options, but not one of them works. Tell me what could be the problem
- hosts: master
become: yes
gather_facts: false
tasks:
- name: get join command
shell: kubeadm token create --print-join-command
register: join_command_raw
- name: set join command
set_fact:
join_command: "{{ join_command_raw.stdout_lines[0] }}"
- hosts: node
become: yes
tasks:
- name: join cluster
shell: "{{ hostvars['master'].join_command_raw }} >> node_joined.txt"
args:
chdir: $HOME
creates: node_joined.txt
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question