This commit is contained in:
2024-09-14 13:09:38 -04:00
parent e7124040c9
commit aad786cb90
9 changed files with 170 additions and 44 deletions

View File

@@ -1,57 +1,36 @@
---
# Master playbook for eom.dev
- name: Initialize systems
hosts: clusters
become: true
roles:
- role: ericomeehan.debian
- role: ericomeehan.ericomeehan
# Playbook for deploying a Kubernetes cluster
- name: Create network bridge
- name: Create virtual machines
- name: Initialize cluster nodes
hosts: clusters
- name: Prepare cluster environments
hosts: cluster_nodes
become: true
pre_tasks:
- name: Update sysctl configuration to enable IPv4 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv4.ip_forward = 1'
state: present
- name: Update sysctl configuration to enable IPv6 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv6.conf.all.forwarding = 1'
state: present
- name: Reload sysctl configuration
command: sysctl --system
- name: Enable br_netfilter kernel module
command: modprobe br_netfilter
- name: Add the module to a configuration file for persistence
lineinfile:
path: /etc/modules-load.d/modules.conf
line: "br_netfilter"
- name: Install kubernetes library
apt:
name: python3-kubernetes
state: present
- name: Enable IPv4 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv4.ip_forward = 1'
state: present
- name: Enable IPv6 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv6.conf.all.forwarding = 1'
state: present
- name: Enable br_netfilter kernel module
command: modprobe br_netfilter
- name: Persist br_netfilter kernel module
lineinfile:
path: /etc/modules-load.d/modules.conf
line: "br_netfilter"
- name: Reload sysctl configuration
command: sysctl --system
roles:
- role: geerlingguy.containerd
- role: geerlingguy.kubernetes
- role: geerlingguy.helm
when: kubernetes_role == 'control_plane'
- role: ericomeehan.nvidia_driver
vars:
- nvidia_driver_debian_install_tesla_driver: true
when: nvidia_driver_needed == true
- name: Deploy services
hosts: alpha-control-plane
vars_files:
- vars/secrets.yaml
become: true
roles:
- role: ericomeehan.eom
vars:
target_namespace: prod
- role: ericomeehan.gondwana
vars:
target_namespace: prod