mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-03-13 13:42:47 +01:00
build
This commit is contained in:
@@ -142,12 +142,6 @@
|
|||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
minutes: 1
|
minutes: 1
|
||||||
|
|
||||||
- name: Initialize Kubernetes
|
|
||||||
command: sudo kubeadm init --pod-network-cidr=10.244.0.0/16
|
|
||||||
args:
|
|
||||||
creates: /etc/kubernetes/admin.conf
|
|
||||||
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
|
||||||
|
|
||||||
- name: Create .kube directory
|
- name: Create .kube directory
|
||||||
file:
|
file:
|
||||||
path: /home/{{ ansible_user }}/.kube
|
path: /home/{{ ansible_user }}/.kube
|
||||||
@@ -171,11 +165,22 @@
|
|||||||
command: kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
|
command: kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
|
||||||
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Get join command
|
- name: Get join command
|
||||||
command: kubeadm token create --print-join-command
|
command: kubeadm token create --print-join-command
|
||||||
register: join_command
|
register: join_command
|
||||||
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
||||||
|
|
||||||
|
- name: Initialize Kubernetes
|
||||||
|
command: sudo kubeadm init --pod-network-cidr=10.244.0.0/16
|
||||||
|
args:
|
||||||
|
creates: /etc/kubernetes/admin.conf
|
||||||
|
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Save join command
|
- name: Save join command
|
||||||
set_fact:
|
set_fact:
|
||||||
worker_join_cmd: "{{ join_command.stdout }}"
|
worker_join_cmd: "{{ join_command.stdout }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user