Files
a13labs.infra/.github/actions/get-host-info/action.yml
T

32 lines
1023 B
YAML

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.system-id }}
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: |
system_id=$(ansible -i ansible/inventory/hosts -b -u $ANSIBLE_USER -m shell -a "read_system_id" $TARGET_HOST | tail -1)
echo "system-id=$system_id" >> $GITHUB_OUTPUT