Add GitHub Actions workflows for OpenTofu K8S Apps apply and validate; update S3 backend configuration
This commit is contained in:
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
name: Terraform K8S Apps apply
|
name: OpenTofu K8S Apps apply
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -31,8 +31,8 @@ jobs:
|
|||||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||||
host-group: microk8s
|
host-group: microk8s
|
||||||
|
|
||||||
- name: Setup Terraform Environment
|
- name: Setup OpenTofu Environment
|
||||||
uses: ./.github/actions/setup-terraform-env
|
uses: ./.github/actions/setup-opentofu-env
|
||||||
|
|
||||||
- name: Setup Kubernetes Environment
|
- name: Setup Kubernetes Environment
|
||||||
uses: ./.github/actions/setup-k8s-env
|
uses: ./.github/actions/setup-k8s-env
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||||
|
|
||||||
- name: Terraform Init and Apply
|
- name: OpenTofu Init and Apply
|
||||||
env:
|
env:
|
||||||
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
||||||
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||||
@@ -51,5 +51,5 @@ jobs:
|
|||||||
SSH_AUTH_SOCK: ${{ steps.setup_ansible_env.outputs.ssh-auth-sock }}
|
SSH_AUTH_SOCK: ${{ steps.setup_ansible_env.outputs.ssh-auth-sock }}
|
||||||
run: |
|
run: |
|
||||||
cd terraform/k8sapps
|
cd terraform/k8sapps
|
||||||
sectool -f ../../sectool.json exec terraform init
|
sectool -f ../../sectool.json exec tofu init
|
||||||
sectool -f ../../sectool.json exec terraform apply --auto-approve
|
sectool -f ../../sectool.json exec tofu apply --auto-approve
|
||||||
+8
-8
@@ -1,4 +1,4 @@
|
|||||||
name: Terraform K8s Apps Validate on Pull Request
|
name: OpenTofu K8s Apps Validate on Pull Request
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -33,8 +33,8 @@ jobs:
|
|||||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||||
host-group: microk8s
|
host-group: microk8s
|
||||||
|
|
||||||
- name: Setup Terraform Environment
|
- name: Setup OpenTofu Environment
|
||||||
uses: ./.github/actions/setup-terraform-env
|
uses: ./.github/actions/setup-opentofu-env
|
||||||
|
|
||||||
- name: Setup Kubernetes Environment
|
- name: Setup Kubernetes Environment
|
||||||
uses: ./.github/actions/setup-k8s-env
|
uses: ./.github/actions/setup-k8s-env
|
||||||
@@ -44,14 +44,14 @@ jobs:
|
|||||||
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
access-token: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||||
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
ansible-user: ${{ secrets.ANSIBLE_USER }}
|
||||||
|
|
||||||
- name: Terraform Init and Validate
|
- name: OpenTofu Init and Validate
|
||||||
env:
|
env:
|
||||||
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
|
||||||
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
|
||||||
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
|
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
cd terraform/k8sapps
|
cd terraform/k8sapps
|
||||||
sectool -f ../../sectool.json exec terraform init
|
sectool -f ../../sectool.json exec tofu init
|
||||||
sectool -f ../../sectool.json exec terraform validate
|
sectool -f ../../sectool.json exec tofu validate
|
||||||
sectool -f ../../sectool.json exec terraform fmt -check
|
sectool -f ../../sectool.json exec tofu fmt -check
|
||||||
sectool -f ../../sectool.json exec terraform plan
|
sectool -f ../../sectool.json exec tofu plan
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
terraform {
|
terraform {
|
||||||
backend "s3" {
|
backend "s3" {
|
||||||
bucket = "a13labs.infra"
|
bucket = "a13labs.infra.eu"
|
||||||
key = "alexpires.me-k8sapps.tfstate"
|
key = "k8sapps.core.infra.tfstate"
|
||||||
region = "us-east-1"
|
region = "eu-west-1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user