Refactor file path and update workflow name in actions-validate.yml
This commit is contained in:
@@ -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
|
||||||
@@ -9,50 +9,7 @@ on:
|
|||||||
- .github/workflows/actions-*.yml
|
- .github/workflows/actions-*.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-setup-ansible-actions:
|
test-cicd-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:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -82,6 +39,13 @@ jobs:
|
|||||||
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
vault-master-password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
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
|
- name: Test ansible
|
||||||
run: |
|
run: |
|
||||||
ansible --version
|
ansible --version
|
||||||
|
|||||||
Reference in New Issue
Block a user