Add Support back for Ubuntu as OS (#546)
Co-authored-by: Willian Paixao <willian@ufpa.br> Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
This commit is contained in:
3 files changed
+71
-17
No files matched your search
@@ -34,6 +34,7 @@ _Additional applications include [hajimari](https://github.com/toboshii/hajimari
|
|||||||
For provisioning the following tools will be used:
|
For provisioning the following tools will be used:
|
||||||
|
|
||||||
- [Fedora 36 Server](https://getfedora.org/en/server/download/) - Universal operating system that supports running all kinds of home related workloads in Kubernetes and has a faster release cycle
|
- [Fedora 36 Server](https://getfedora.org/en/server/download/) - Universal operating system that supports running all kinds of home related workloads in Kubernetes and has a faster release cycle
|
||||||
|
- [Ubuntu 22.04 Server](https://ubuntu.com/download/server) - Alternative operating system, limited community support
|
||||||
- [Ansible](https://www.ansible.com) - Provision Fedora Server and install k3s
|
- [Ansible](https://www.ansible.com) - Provision Fedora Server and install k3s
|
||||||
- [Terraform](https://www.terraform.io) - Provision an already existing Cloudflare domain and certain DNS records to be used with your k3s cluster
|
- [Terraform](https://www.terraform.io) - Provision an already existing Cloudflare domain and certain DNS records to be used with your k3s cluster
|
||||||
|
|
||||||
|
|||||||
@@ -5,15 +5,29 @@
|
|||||||
# (list) Additional ssh public keys to add to the nodes
|
# (list) Additional ssh public keys to add to the nodes
|
||||||
# ssh_authorized_keys:
|
# ssh_authorized_keys:
|
||||||
|
|
||||||
packages:
|
fedora:
|
||||||
- dnf-plugin-system-upgrade
|
packages:
|
||||||
- dnf-utils
|
- dnf-plugin-system-upgrade
|
||||||
- hdparm
|
- dnf-utils
|
||||||
- htop
|
- hdparm
|
||||||
- intel-gpu-tools
|
- htop
|
||||||
- ipvsadm
|
- intel-gpu-tools
|
||||||
- lm_sensors
|
- ipvsadm
|
||||||
- nano
|
- lm_sensors
|
||||||
- nvme-cli
|
- nano
|
||||||
- socat
|
- nvme-cli
|
||||||
- python3-libselinux
|
- socat
|
||||||
|
- python3-libselinux
|
||||||
|
|
||||||
|
ubuntu:
|
||||||
|
# disable_ufw: true
|
||||||
|
# disable_swap: true
|
||||||
|
packages:
|
||||||
|
- hdparm
|
||||||
|
- htop
|
||||||
|
- intel-gpu-tools
|
||||||
|
- ipvsadm
|
||||||
|
- lm-sensors
|
||||||
|
- nano
|
||||||
|
- nvme-cli
|
||||||
|
- socat
|
||||||
@@ -25,16 +25,28 @@
|
|||||||
path: /etc/hosts
|
path: /etc/hosts
|
||||||
block: |
|
block: |
|
||||||
127.0.1.1 {{ inventory_hostname }}
|
127.0.1.1 {{ inventory_hostname }}
|
||||||
- name: Packages
|
- name: Packages | Fedora
|
||||||
block:
|
block:
|
||||||
- name: Packages | Install required packages
|
- name: Packages | Install required packages
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "{{ packages | default([]) }}"
|
name: "{{ fedora.packages | default([]) }}"
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
- name: Packages | Remove leaf packages
|
- name: Packages | Remove leaf packages
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
autoremove: true
|
autoremove: true
|
||||||
|
when: ansible_facts['distribution'] == 'Fedora'
|
||||||
|
- name: Packages | Ubuntu
|
||||||
|
block:
|
||||||
|
- name: Packages | Install required packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "{{ ubuntu.packages | default([]) }}"
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
- name: Packages | Remove leaf packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoremove: true
|
||||||
|
when: ansible_facts['distribution'] == 'Ubuntu'
|
||||||
- name: User Configuration
|
- name: User Configuration
|
||||||
block:
|
block:
|
||||||
- name: User Configuration | Add additional SSH public keys
|
- name: User Configuration | Add additional SSH public keys
|
||||||
@@ -44,12 +56,22 @@
|
|||||||
loop: "{{ public_ssh_keys | default([]) }}"
|
loop: "{{ public_ssh_keys | default([]) }}"
|
||||||
- name: System Configuration (1)
|
- name: System Configuration (1)
|
||||||
block:
|
block:
|
||||||
- name: System Configuration (1) | Disable firewalld
|
- name: System Configuration (1) | Disable firewalld | Fedora
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
service: firewalld.service
|
service: firewalld.service
|
||||||
enabled: false
|
enabled: false
|
||||||
masked: true
|
masked: true
|
||||||
state: stopped
|
state: stopped
|
||||||
|
when: ansible_facts['distribution'] == 'Fedora'
|
||||||
|
- name: System Configuration (1) | Disable ufw | Ubuntu
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
service: ufw.service
|
||||||
|
enabled: false
|
||||||
|
masked: true
|
||||||
|
state: stopped
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'Ubuntu'
|
||||||
|
- "{{ ubuntu.disable_ufw | default true }}" == true
|
||||||
- name: System Configuration (1) | Enable fstrim
|
- name: System Configuration (1) | Enable fstrim
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
service: fstrim.timer
|
service: fstrim.timer
|
||||||
@@ -85,14 +107,31 @@
|
|||||||
net.bridge.bridge-nf-call-ip6tables: 1
|
net.bridge.bridge-nf-call-ip6tables: 1
|
||||||
fs.inotify.max_user_watches: 524288
|
fs.inotify.max_user_watches: 524288
|
||||||
fs.inotify.max_user_instances: 512
|
fs.inotify.max_user_instances: 512
|
||||||
- name: System Configuration (2) | Disable swap
|
- name: System Configuration (2) | Disable swap | Fedora
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: zram-generator-defaults
|
name: zram-generator-defaults
|
||||||
state: absent
|
state: absent
|
||||||
- name: System Configuration (2) | Permissive SELinux
|
when: ansible_facts['distribution'] == 'Fedora'
|
||||||
|
- name: System Configuration (2) | Disable swap at runtime | Ubuntu
|
||||||
|
ansible.builtin.command: swapoff -a
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'Ubuntu'
|
||||||
|
- "{{ ubuntu.disable_swap | default true }}" == true
|
||||||
|
- ansible_swaptotal_mb > 0
|
||||||
|
- name: System Configuration (2) | Disable swap at boot | Ubuntu
|
||||||
|
ansible.posix.mount:
|
||||||
|
name: "{{ item }}"
|
||||||
|
fstype: swap
|
||||||
|
state: absent
|
||||||
|
loop: ["none", "swap"]
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'Ubuntu'
|
||||||
|
- "{{ ubuntu.disable_swap | default true }}" == true
|
||||||
|
- name: System Configuration (2) | Permissive SELinux | Fedora
|
||||||
ansible.posix.selinux:
|
ansible.posix.selinux:
|
||||||
state: permissive
|
state: permissive
|
||||||
policy: targeted
|
policy: targeted
|
||||||
|
when: ansible_facts['distribution'] == 'Fedora'
|
||||||
notify: Reboot
|
notify: Reboot
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
|
|||||||
Reference in new issue
Block a user