mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2025-10-02 08:26:17 +00:00
Merge pull request #90 from jdratlif/main
A few updates for the RKE2 ansible plays
This commit is contained in:
3
Ansible/Playbooks/RKE2/ansible.cfg
Normal file
3
Ansible/Playbooks/RKE2/ansible.cfg
Normal file
@@ -0,0 +1,3 @@
|
||||
[defaults]
|
||||
inventory = inventory/hosts.ini
|
||||
host_key_checking = false
|
@@ -1,18 +1,18 @@
|
||||
---
|
||||
os: "linux"
|
||||
arch: "amd64"
|
||||
|
||||
kube_vip_version: "v0.8.0"
|
||||
vip_interface: eth0
|
||||
vip: 192.168.3.50
|
||||
|
||||
metallb_version: v0.13.12
|
||||
lb_range: 192.168.3.80-192.168.3.90
|
||||
lb_pool_name: first-pool
|
||||
|
||||
rke2_version: "v1.29.4+rke2r1"
|
||||
rke2_install_dir: "/usr/local/bin"
|
||||
rke2_binary_url: "https://github.com/rancher/rke2/releases/download/{{ rke2_version }}/rke2.linux-amd64"
|
||||
|
||||
ansible_user: ubuntu
|
||||
ansible_become: true
|
||||
ansible_become_method: sudo
|
||||
################################################################################
|
||||
# options to change default values
|
||||
# kube_vip_version: "v0.8.0"
|
||||
# vip_interface: "eth0"
|
||||
# rke2_version: "v1.29.4+rke2r1"
|
||||
# rke2_install_dir: "/usr/local/bin"
|
||||
|
@@ -9,3 +9,12 @@ server3 ansible_host=192.168.3.23
|
||||
[agents]
|
||||
agent1 ansible_host=192.168.3.24
|
||||
agent2 ansible_host=192.168.3.25
|
||||
|
||||
[rke2]
|
||||
|
||||
[rke2:children]
|
||||
servers
|
||||
agents
|
||||
|
||||
[rke2:vars]
|
||||
ansible_user=ansible
|
||||
|
3
Ansible/Playbooks/RKE2/roles/kube-vip/defaults/main.yaml
Normal file
3
Ansible/Playbooks/RKE2/roles/kube-vip/defaults/main.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
kube_vip_version: v0.8.0
|
||||
vip_interface: eth0
|
@@ -0,0 +1,22 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Install kube-vip manifest
|
||||
description: Install kube-vip manifest
|
||||
author:
|
||||
- James Turland <james@turland.uk>
|
||||
options:
|
||||
kube_vip_version:
|
||||
type: str
|
||||
required: false
|
||||
default: v0.8.0
|
||||
description: Version of kube-vip to install
|
||||
vip_interface:
|
||||
type: str
|
||||
required: false
|
||||
default: eth0
|
||||
description: Interface to bind kube-vip
|
||||
vip:
|
||||
type: str
|
||||
required: true
|
||||
description: The virtual IP to use with kube-vip
|
@@ -3,7 +3,7 @@
|
||||
ansible.builtin.file:
|
||||
path: "/var/lib/rancher/rke2/server/manifests"
|
||||
state: directory
|
||||
mode: '0644'
|
||||
mode: "0755"
|
||||
when: inventory_hostname in groups['servers']
|
||||
|
||||
# Copy kube-vip to server 1 manifest folder for auto deployment at bootstrap
|
||||
@@ -13,5 +13,5 @@
|
||||
dest: /var/lib/rancher/rke2/server/manifests/kube-vip.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
mode: "0644"
|
||||
when: inventory_hostname == groups['servers'][0]
|
||||
|
@@ -0,0 +1,3 @@
|
||||
---
|
||||
rke2_install_dir: "/usr/local/bin"
|
||||
rke2_version: "v1.29.4+rke2r1"
|
@@ -0,0 +1,2 @@
|
||||
---
|
||||
rke2_binary_url: "https://github.com/rancher/rke2/releases/download/{{ rke2_version }}/rke2.{{ os }}-{{ arch }}"
|
||||
|
@@ -13,16 +13,11 @@
|
||||
|
||||
# bootstraps first server and copies configs for others/agents
|
||||
- name: Prepare all nodes
|
||||
hosts: servers,agents
|
||||
gather_facts: true # enables us to gather lots of useful variables: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/setup_module.html
|
||||
hosts: rke2
|
||||
gather_facts: false # fact gathering is slow and not needed for any of our tasks
|
||||
become: true
|
||||
roles:
|
||||
- prepare-nodes
|
||||
|
||||
# creates directories for download and then downloads RKE2 and changes permissions
|
||||
- name: Download RKE2
|
||||
hosts: servers,agents
|
||||
gather_facts: true
|
||||
roles:
|
||||
- rke2-download
|
||||
|
||||
# Creates RKE2 bootstrap manifests folder and copies kube-vip template over (configured with variables)
|
||||
|
Reference in New Issue
Block a user