Refactor workflow file to include self-reference in paths and update Ansible setup
This commit is contained in:
@@ -6,6 +6,7 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- "terraform/k8sapps/**"
|
||||
- .github/workflows/terraform-microk8s-apply.yml
|
||||
|
||||
jobs:
|
||||
terraform-apply:
|
||||
@@ -21,6 +22,7 @@ jobs:
|
||||
uses: ./.github/actions/setup-env
|
||||
|
||||
- name: Setup Ansible Environment
|
||||
id: setup_ansible_env
|
||||
uses: ./.github/actions/setup-ansible-env
|
||||
with:
|
||||
vault-master_password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
@@ -36,19 +38,12 @@ jobs:
|
||||
vault-master_password: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||
|
||||
- name: Terraform Init
|
||||
env:
|
||||
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
run: |
|
||||
cd terraform/k8sapps
|
||||
sectool exec terraform init
|
||||
|
||||
- name: Terraform Apply
|
||||
env:
|
||||
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||
ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }}
|
||||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||
SSH_AUTH_SOCK: ${{ steps.setup_ansible_env.outputs.ssh-auth-sock }}
|
||||
run: |
|
||||
# Apply the Terraform configuration
|
||||
cd terraform/k8sapps
|
||||
sectool exec terraform init
|
||||
sectool exec terraform apply --auto-approve
|
||||
|
||||
Reference in New Issue
Block a user