-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Derek Nola <[email protected]>
- Loading branch information
Showing
15 changed files
with
74 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
|
||
- hosts: k3s_cluster | ||
- name: Reset K3s cluster | ||
hosts: k3s_cluster | ||
gather_facts: yes | ||
become: yes | ||
roles: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
- name: reboot | ||
reboot: | ||
- name: Reboot | ||
ansible.builtin.reboot: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
--- | ||
- name: Check if /boot/firmware/cmdline.txt exists | ||
stat: | ||
ansible.builtin.stat: | ||
path: /boot/firmware/cmdline.txt | ||
register: boot_firmware_cmdline_txt | ||
|
||
- name: Activating cgroup support | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
path: "{{ (boot_firmware_cmdline_txt.stat.exists) | ternary('/boot/firmware/cmdline.txt', '/boot/cmdline.txt') }}" | ||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' | ||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' | ||
backrefs: true | ||
notify: reboot | ||
|
||
- name: Install iptables | ||
apt: | ||
ansible.builtin.apt: | ||
name: iptables | ||
|
||
- name: Flush iptables before changing to iptables-legacy | ||
iptables: | ||
ansible.builtin.iptables: | ||
flush: true | ||
changed_when: false # iptables flush always returns changed | ||
|
||
- name: Changing to iptables-legacy | ||
alternatives: | ||
community.general.alternatives: | ||
path: /usr/sbin/iptables-legacy | ||
name: iptables | ||
register: ip4_legacy | ||
|
||
- name: Changing to ip6tables-legacy | ||
alternatives: | ||
community.general.alternatives: | ||
path: /usr/sbin/ip6tables-legacy | ||
name: ip6tables | ||
register: ip6_legacy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
--- | ||
- name: Activating cgroup support | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
path: /boot/cmdline.txt | ||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' | ||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' | ||
backrefs: true | ||
notify: reboot | ||
|
||
- name: Flush iptables before changing to iptables-legacy | ||
iptables: | ||
ansible.builtin.iptables: | ||
flush: true | ||
changed_when: false # iptables flush always returns changed | ||
|
||
- name: Changing to iptables-legacy | ||
alternatives: | ||
community.general.alternatives: | ||
path: /usr/sbin/iptables-legacy | ||
name: iptables | ||
register: ip4_legacy | ||
|
||
- name: Changing to ip6tables-legacy | ||
alternatives: | ||
community.general.alternatives: | ||
path: /usr/sbin/ip6tables-legacy | ||
name: ip6tables | ||
register: ip6_legacy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
--- | ||
- name: Enable cgroup via boot commandline if not already enabled for Ubuntu on a Raspberry Pi | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
path: /boot/firmware/cmdline.txt | ||
backrefs: yes | ||
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' | ||
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' | ||
notify: reboot | ||
- name: Install Ubuntu Raspi Extra Packages | ||
apt: | ||
name: | ||
- linux-modules-extra-raspi #Fixes issues in newer Ubuntu where VXLan isn't setup right. See: https://github.com/k3s-io/k3s/issues/4234 | ||
ansible.builtin.apt: | ||
# Fixes issues in newer Ubuntu where VXLan isn't setup right. | ||
# See: https://github.com/k3s-io/k3s/issues/4234 | ||
name: linux-modules-extra-raspi | ||
update_cache: yes | ||
state: present | ||
when: "ansible_distribution_version is version('20.10', '>=')" | ||
when: "ansible_distribution_version is version('20.10', '>=')" |
Oops, something went wrong.