forked from techno-tim/k3s-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop support for CentOS, test Rocky and Debian in CI (techno-tim#92)
* Test CentOS 7 in CI * Drop support for CentOS, test on Rocky and Debian * Fix reset playbook for Rocky Linux * Fix typo * Disable firewalld during testing Co-authored-by: Techno Tim <[email protected]>
- Loading branch information
1 parent
5225493
commit d5b37ac
Showing
18 changed files
with
150 additions
and
45 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,34 @@ | ||
#!/bin/bash | ||
|
||
# download-boxes.sh | ||
# Check all molecule.yml files for required Vagrant boxes and download the ones that are not | ||
# already present on the system. | ||
|
||
set -euo pipefail | ||
|
||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
PROVIDER=virtualbox | ||
|
||
# Read all boxes for all platforms from the "molecule.yml" files | ||
all_boxes=$(cat "${GIT_ROOT}"/molecule/*/molecule.yml | | ||
yq -r '.platforms[].box' | # Read the "box" property of each node under "platforms" | ||
grep --invert-match --regexp=--- | # Filter out file separators | ||
sort | | ||
uniq) | ||
|
||
# Read the boxes that are currently present on the system (for the current provider) | ||
present_boxes=$(vagrant box list | | ||
grep "${PROVIDER}" | # Filter by boxes available for the current provider | ||
awk '{print $1;}' | # The box name is the first word in each line | ||
sort | | ||
uniq) | ||
|
||
# The boxes that we need to download are the ones present in $all_boxes, but not $present_boxes. | ||
download_boxes=$(comm -2 -3 <(echo "${all_boxes}") <(echo "${present_boxes}")) | ||
|
||
# Actually download the necessary boxes | ||
if [ -n "${download_boxes}" ]; then | ||
echo "${download_boxes}" | while IFS= read -r box; do | ||
vagrant box add --provider "${PROVIDER}" "${box}" | ||
done | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Apply overrides | ||
ansible.builtin.import_playbook: >- | ||
{{ lookup("ansible.builtin.env", "MOLECULE_SCENARIO_DIRECTORY") }}/overrides.yml | ||
- name: Network setup | ||
hosts: all | ||
tasks: | ||
- name: Disable firewalld | ||
when: ansible_distribution == "Rocky" | ||
# Rocky Linux comes with firewalld enabled. It blocks some of the network | ||
# connections needed for our k3s cluster. For our test setup, we just disable | ||
# it since the VM host's firewall is still active for connections to and from | ||
# the Internet. | ||
# When building your own cluster, please DO NOT blindly copy this. Instead, | ||
# please create a custom firewall configuration that fits your network design | ||
# and security needs. | ||
ansible.builtin.systemd: | ||
name: firewalld | ||
enabled: no | ||
state: stopped | ||
become: true |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# Indicates whether the k3s prerequisites for Raspberry Pi should be set up | ||
# Possible values: | ||
# - present | ||
# - absent | ||
state: present |
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
roles/raspberrypi/tasks/prereq/CentOS.yml → roles/raspberrypi/tasks/setup/Rocky.yml
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
File renamed without changes.
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 @@ | ||
--- |
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 @@ | ||
--- |
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,5 @@ | ||
--- | ||
- name: Remove linux-modules-extra-raspi | ||
apt: | ||
name: linux-modules-extra-raspi | ||
state: absent |
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 @@ | ||
--- |
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