Skip to content

Commit

Permalink
feat: Lab v1 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota authored Oct 10, 2024
1 parent 0d5e839 commit 408aac7
Show file tree
Hide file tree
Showing 120 changed files with 2,266 additions and 3,414 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ exclude_paths:
- .github/
- node_modules/
- "**/*.sops.yml"
- "**/*.sops.yaml"
- ".sops.yaml"
- "**/inventory/hosts.yaml"

use_default_rules: true

Expand Down
2 changes: 1 addition & 1 deletion .ansible-lint-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ roles/gluster_server/tasks/create-volume-quota.yml var-naming[no-role-prefix]
roles/gluster_client/tasks/main.yml var-naming[no-role-prefix]
roles/pve_virtual_machines/tasks/main.yml var-naming[no-role-prefix]
roles/pve_virtual_machines/tasks/vm.yml var-naming[no-role-prefix]
playbooks/nvidia.yml name[casing]
playbooks/nvidia.yml name[casing]
43 changes: 0 additions & 43 deletions .github/workflows/cd.yml

This file was deleted.

46 changes: 1 addition & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,13 @@ jobs:

- name: Install pre-requisites
run: |
yarn
sudo wget -q -O /usr/bin/sops https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.amd64
sudo chmod a+x /usr/bin/sops
sudo pip install --upgrade pip
sudo pip uninstall -y ansible-core
pip install --force-reinstall ansible==7.6.0
pip install --force-reinstall ansible-lint==6.17.0
SKIP_PLAYBOOKS=1 yarn install
- name: Lint Ansible files
run: yarn lint

- name: Compare values across environments
run: yarn validate-values
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}

deploy-lab:
runs-on: self-hosted
needs:
- validate
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Write ssh key
run: |
echo "${{ secrets.SSH_KEY }}" > ${{ runner.temp }}/ssh.key
chmod 0600 ${{ runner.temp }}/ssh.key
- name: Run Ansible playbooks
run: yarn lab:apply _all -e ansible_user=github-runner --private-key ${{ runner.temp }}/ssh.key
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}
ANSIBLE_HOST_KEY_CHECKING: "false"

e2e-lab-local:
uses: homecentr/e2e/.github/workflows/run-e2e.yml@master
needs:
- deploy-lab
with:
environment: lab
client: local
secrets:
sops_age_key: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}

e2e-lab-remote:
uses: homecentr/e2e/.github/workflows/run-e2e.yml@master
needs:
- deploy-lab
with:
environment: lab
client: remote
secrets:
sops_age_key: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**/tests_output
**/screenshots

*.key
*.crt
.images
Expand Down
2 changes: 1 addition & 1 deletion .sops.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
creation_rules:
- path_regex: ".*environments.*\\.sops\\.ya?ml$"
- path_regex: ".*inventory.*\\.sops\\.ya?ml$"
# Workaround for https://github.com/mozilla/sops/issues/1103 where sops does not currently work correctly with age via YubiKey
pgp: 2D1D9C803F35BBC24014C3906601E1EB2454827F # lholota
age: > # GitHub
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[defaults]
vars_plugins_enabled = host_group_vars,community.sops.sops
timeout = 30
timeout = 30
2 changes: 0 additions & 2 deletions environments/lab/group_vars/all/general.yml

This file was deleted.

1 change: 0 additions & 1 deletion environments/lab/group_vars/all/node-exporter.yml

This file was deleted.

41 changes: 0 additions & 41 deletions environments/lab/group_vars/all/ups.sops.yml

This file was deleted.

6 changes: 0 additions & 6 deletions environments/lab/group_vars/all/ups.yml

This file was deleted.

53 changes: 0 additions & 53 deletions environments/lab/group_vars/all/users.sops.yml

This file was deleted.

Loading

0 comments on commit 408aac7

Please sign in to comment.