-
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.
- Loading branch information
Showing
45 changed files
with
430 additions
and
140 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,95 @@ | ||
--- | ||
name: CI | ||
|
||
'on': | ||
push: {} | ||
pull_request: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
ANSIBLE_FORCE_COLOR: '1' | ||
ANSIBLE_CONFIG: ci/ansible.cfg | ||
|
||
jobs: | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Python dependencies | ||
run: python3 -m pip install -r requirements.txt | ||
|
||
- name: Install Ansible Galaxy dependencies | ||
run: ansible-galaxy install -r requirements.yml | ||
|
||
- name: Run YAML linter | ||
run: yamllint . | ||
|
||
- name: Run Ansible syntax check | ||
run: ansible-playbook main.yml --syntax-check | ||
|
||
- name: Run Ansible linter | ||
run: ansible-lint | ||
|
||
run-playbook: | ||
name: Run playbook | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Check out sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
cache: pip | ||
|
||
- name: Install Python dependencies | ||
run: python3 -m pip install -r requirements.txt | ||
|
||
- name: Install Ansible Galaxy dependencies | ||
run: ansible-galaxy install -r requirements.yml | ||
|
||
- name: Remove encrypted secrets | ||
run: grep -lZ -e '^\$ANSIBLE_VAULT' group_vars/*/*.yml | xargs -0 rm -f | ||
|
||
- name: Use sample config | ||
run: cp -f config.yml.sample config.yml | ||
|
||
- name: Run playbook (first run) | ||
run: ansible-playbook main.yml --extra-vars '@ci/config_overrides.yml' | ||
|
||
- name: Run playbook (second run) | ||
run: ansible-playbook main.yml --extra-vars '@ci/config_overrides.yml' | tee /tmp/secondrun.log | ||
|
||
- name: Upload second run output as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: second-run-output | ||
path: /tmp/secondrun.log | ||
|
||
idempotence: | ||
name: Check idempotence | ||
runs-on: ubuntu-latest | ||
needs: run-playbook | ||
steps: | ||
- name: Download second run output artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: second-run-output | ||
|
||
- name: Check idempotence | ||
run: >- | ||
grep -A1 -e 'PLAY RECAP' secondrun.log | grep -q -e 'changed=0.*failed=0' | ||
&& (echo 'Idempotence test: pass' && exit 0) | ||
|| (echo 'Idempotence test: fail' && exit 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
keys/* | ||
!keys/README.md | ||
inventory | ||
/inventory | ||
.facts_cache | ||
vault_password.txt | ||
venv/ | ||
|
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 +1,3 @@ | ||
group_vars/homeserver/secrets.yml | ||
group_vars/homeserver/prometheus_scrape_configs.yml | ||
roles/monitoring/templates/prometheus.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
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,10 @@ | ||
[defaults] | ||
nocows = True | ||
library = ../library | ||
inventory = inventory | ||
stdout_callback = ansible.posix.debug | ||
strategy = free | ||
callbacks_enabled = ansible.posix.profile_tasks | ||
|
||
[callback_profile_tasks] | ||
task_output_limit = 0 |
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,41 @@ | ||
--- | ||
storage: | ||
data_dir: /data | ||
nas_dir: /nas | ||
docker_dir: /var/lib/docker | ||
|
||
# Don't create LVM volumes since we don't control the disk setup | ||
vg: pool | ||
volumes: {} | ||
|
||
dnsmasq_port: 54 | ||
|
||
# Jellyfin takes too long to start on the GitHub Actions runner. | ||
# TODO: Figure out why this is the case. | ||
jellyfin_skip_setup: yes | ||
|
||
|
||
########### | ||
# SECRETS # | ||
########### | ||
|
||
minio_root_user: "minio" | ||
minio_root_password: "minio" | ||
|
||
secret_authentik_pg_pass: authentik | ||
secret_authentik_bootstrap_email: authentik | ||
secret_authentik_bootstrap_password: authentik | ||
|
||
secret_homarr_oidc_client_id: homarrclientid | ||
secret_homarr_oidc_client_secret: homarrclientsecret | ||
|
||
secret_minio_openid_client_id: minioclientid | ||
secret_minio_openid_client_secret: minioclientsecret | ||
|
||
secret_jellyfin_admin_username: jellyfin | ||
secret_jellyfin_admin_password: jellyfin | ||
secret_jellyfin_oidc_client_id: jellyfinclientid | ||
secret_jellyfin_oidc_client_secret: jellyfinclientsecret | ||
|
||
secret_monitoring_grafana_client_id: grafanaclientid | ||
secret_monitoring_grafana_client_secret: grafanaclientsecret |
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 @@ | ||
[homeserver] | ||
localhost ansible_connection=local |
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
Oops, something went wrong.