feat: add ansible-lint and yamlfmt
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
---
|
||||
- name: Install required packages
|
||||
ansible.builtin.import_tasks: packages.yaml
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
- name: Install Python 3 Dependencies
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Initialise high-availability Kubernetes cluster
|
||||
ansible.builtin.command: >-
|
||||
kubeadm init
|
||||
--pod-network-cidr="172.16.0.0/16"
|
||||
--control-plane-endpoint="{{ ansible_default_ipv4.address }}:6443"
|
||||
--upload-certs
|
||||
args:
|
||||
creates: /etc/kubernetes/admin.conf
|
||||
|
||||
- name: Copy Kubernetes Admin Config
|
||||
ansible.builtin.command: "{{ item }}"
|
||||
loop:
|
||||
- mkdir -p $HOME/.kube
|
||||
- cp /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||
- chown $(id -u):$(id -g) $HOME/.kube/config
|
||||
args:
|
||||
creates: $HOME/.kube/config
|
||||
|
||||
- name: Install Pod Network (Calico)
|
||||
ansible.builtin.shell: kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.32.0/manifests/calico.yaml > pod_network_setup.txt
|
||||
args:
|
||||
chdir: $HOME
|
||||
creates: pod_network_setup.txt
|
||||
@@ -1,9 +1,6 @@
|
||||
---
|
||||
- name: Install Kubernetes APT repository
|
||||
ansible.builtin.import_tasks: repo.yaml
|
||||
|
||||
- name: Install Kubernetes packages
|
||||
ansible.builtin.import_tasks: packages.yaml
|
||||
|
||||
- name: Configure networking
|
||||
ansible.builtin.import_tasks: networking.yaml
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
- name: Enable sysctl 'net.ipv4.ip_forward'
|
||||
ansible.posix.sysctl:
|
||||
name: net.ipv4.ip_forward
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
- name: Install Kubernetes packages
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
@@ -6,7 +5,6 @@
|
||||
- kubelet
|
||||
- containerd
|
||||
update_cache: true
|
||||
|
||||
- name: Activate containerd service
|
||||
ansible.builtin.service:
|
||||
name: containerd
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
- name: Add Kubernetes APT repository
|
||||
ansible.builtin.deb822_repository:
|
||||
name: kubernetes
|
||||
|
||||
Reference in New Issue
Block a user