Temporarily disable GitLab CI and add Gitea Actions.
OpenVPN Ansible / Ansible Lint (push) Failing after 58s
OpenVPN Ansible / Ansible Syntax Check (push) Failing after 4s
OpenVPN Ansible / Deploy OpenVPN (push) Skipped
OpenVPN Ansible / Generate SBOM (push) Skipped
OpenVPN Ansible / Scan SBOM with Trivy (push) Skipped
OpenVPN Ansible / Ansible Lint (push) Failing after 58s
OpenVPN Ansible / Ansible Syntax Check (push) Failing after 4s
OpenVPN Ansible / Deploy OpenVPN (push) Skipped
OpenVPN Ansible / Generate SBOM (push) Skipped
OpenVPN Ansible / Scan SBOM with Trivy (push) Skipped
This commit is contained in:
@@ -0,0 +1,191 @@
|
|||||||
|
name: OpenVPN Ansible
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
ansible-lint:
|
||||||
|
name: Ansible Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
echo "Setting up SSH ..."
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
|
||||||
|
chmod 644 ~/.ssh/id_ed25519.pub
|
||||||
|
|
||||||
|
- name: Run ansible-lint
|
||||||
|
run: ansible-lint
|
||||||
|
|
||||||
|
|
||||||
|
syntax-check:
|
||||||
|
name: Ansible Syntax Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
|
||||||
|
chmod 644 ~/.ssh/id_ed25519.pub
|
||||||
|
|
||||||
|
- name: Syntax check
|
||||||
|
env:
|
||||||
|
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible.cfg
|
||||||
|
run: |
|
||||||
|
ansible-playbook --syntax-check playbooks/openvpn.yml
|
||||||
|
|
||||||
|
|
||||||
|
deploy-prod:
|
||||||
|
name: Deploy OpenVPN
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- ansible-lint
|
||||||
|
- syntax-check
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
|
||||||
|
chmod 644 ~/.ssh/id_ed25519.pub
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
env:
|
||||||
|
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible.cfg
|
||||||
|
run: |
|
||||||
|
ansible-playbook playbooks/openvpn.yml
|
||||||
|
|
||||||
|
|
||||||
|
sbom:
|
||||||
|
name: Generate SBOM
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- deploy-prod
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
||||||
|
echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519.pub
|
||||||
|
chmod 644 ~/.ssh/id_ed25519.pub
|
||||||
|
|
||||||
|
- name: Generate SBOM
|
||||||
|
env:
|
||||||
|
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible.cfg
|
||||||
|
run: |
|
||||||
|
ansible-playbook playbooks/sbom.yml
|
||||||
|
|
||||||
|
- name: Upload SBOM
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sbom
|
||||||
|
path: reports/sbom/
|
||||||
|
retention-days: 365
|
||||||
|
|
||||||
|
|
||||||
|
trivy-sbom:
|
||||||
|
name: Scan SBOM with Trivy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
needs:
|
||||||
|
- sbom
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: gitea.infrastructure.helmholz.cloud/gitea_admin/ansible-utilities:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download SBOM
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: sbom
|
||||||
|
path: reports/sbom/
|
||||||
|
|
||||||
|
- name: Scan SBOMs
|
||||||
|
run: |
|
||||||
|
ls -R reports || true
|
||||||
|
|
||||||
|
mkdir -p reports/trivy
|
||||||
|
|
||||||
|
if compgen -G "reports/sbom/*.json" > /dev/null; then
|
||||||
|
|
||||||
|
for sbom in reports/sbom/*.json; do
|
||||||
|
filename=$(basename "$sbom" .json)
|
||||||
|
|
||||||
|
echo "Scanning $sbom"
|
||||||
|
|
||||||
|
trivy sbom \
|
||||||
|
--format json \
|
||||||
|
--output "reports/trivy/${filename}-trivy.json" \
|
||||||
|
--exit-code 0 \
|
||||||
|
"$sbom"
|
||||||
|
|
||||||
|
trivy sbom \
|
||||||
|
--format table \
|
||||||
|
--output "reports/trivy/${filename}-trivy.txt" \
|
||||||
|
--exit-code 0 \
|
||||||
|
"$sbom"
|
||||||
|
done
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "No SBOM files found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload Trivy reports
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: trivy-reports
|
||||||
|
path: reports/trivy/
|
||||||
|
retention-days: 365
|
||||||
@@ -30,6 +30,7 @@ deploy-prod:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- ansible-playbook playbooks/openvpn.yml
|
- ansible-playbook playbooks/openvpn.yml
|
||||||
|
when: manual
|
||||||
|
|
||||||
sbom:
|
sbom:
|
||||||
stage: security
|
stage: security
|
||||||
|
|||||||
Reference in New Issue
Block a user