mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-03-13 05:42:46 +01:00
build
This commit is contained in:
@@ -135,12 +135,15 @@
|
|||||||
|
|
||||||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
|
||||||
SystemdCgroup = true
|
SystemdCgroup = true
|
||||||
notify:
|
|
||||||
- restart containerd
|
- name: Enable and start containerd
|
||||||
|
systemd:
|
||||||
|
name: containerd
|
||||||
|
state: restarted
|
||||||
|
|
||||||
- name: Pause for 5 minutes to build app cache
|
- name: Pause for 5 minutes to build app cache
|
||||||
ansible.builtin.pause:
|
ansible.builtin.pause:
|
||||||
minutes: 1
|
minutes: 2
|
||||||
|
|
||||||
- name: Create .kube directory
|
- name: Create .kube directory
|
||||||
file:
|
file:
|
||||||
@@ -151,6 +154,11 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
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: Copy kubeconfig to user
|
- name: Copy kubeconfig to user
|
||||||
@@ -164,20 +172,17 @@
|
|||||||
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
when: inventory_hostname == 'ubuntu24-vm01.home.lan'
|
||||||
|
|
||||||
- name: Install Flannel CNI
|
- name: Install Flannel CNI
|
||||||
|
become_user: "{{ ansible_user }}"
|
||||||
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: sudo 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'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user