Refactor file path and update workflow name in actions-validate.yml

This commit is contained in:
2024-09-30 21:59:58 +02:00
parent 6fdaf8aac9
commit adfff953e7
2 changed files with 38 additions and 44 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Setup K8S Environment
description: Prepare the environment for A13labs CI/CD pipelines
inputs:
vault-master-password:
description: "The master password for the vault"
required: true
ansible-user:
description: "The user to use for Ansible"
required: true
target-host:
description: "The target host to read the system ID"
default: "microk8s"
outputs:
system_id:
description: "The system ID of the target host"
value: ${{ steps.get-system-id.outputs.stdout }}
runs:
using: "composite"
steps:
- name: Get System ID
id: get-system-id
shell: bash
env:
VAULT_MASTER_PASSWORD: ${{ inputs.vault-master-password }}
ANSIBLE_USER: ${{ inputs.ansible-user }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
TARGET_HOST: ${{ inputs.target-host }}
run: |
ansible -i ansible/inventory/hosts -b -u $ANSIBLE_USER -m shell -a "read_system_id" $TARGET_HOST | tail -1
+8 -44
View File
@@ -9,50 +9,7 @@ on:
- .github/workflows/actions-*.yml
jobs:
test-setup-ansible-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Setup Ansible environment
uses: ./.github/actions/setup-ansible-env
with:
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
ansible-user: ${{ secrets.ANSIBLE_USER }}
trusted-hosts: ${{ secrets.TRUSTED_HOSTS }}
- name: Test ansible
run: |
ansible --version
test-setup-terraform-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.9.6
- name: Test terraform
run: |
terraform --version
test-setup-terraforms-k8s-actions:
test-cicd-actions:
runs-on: ubuntu-latest
steps:
@@ -82,6 +39,13 @@ jobs:
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
ansible-user: ${{ secrets.ANSIBLE_USER }}
- name: Get Host Info
uses: ./.github/actions/get-host-info
id: get-host-info
with:
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
ansible-user: ${{ secrets.ANSIBLE_USER }}
- name: Test ansible
run: |
ansible --version