Skip to content

Commit 34401ee

Browse files
committed
Fixing pipelines
1 parent c9feeb8 commit 34401ee

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

.github/workflows/apply.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
- name: Copy SSH area
3030
run: cp -r /root/.ssh /github/home/
3131

32+
- name: Ansible
33+
run: |
34+
ansible-galaxy install -r ansible/requirements.yml
35+
ansible-playbook ansible/site.yml -u ${{ secrets.SSH_USER }} -i "${{ secrets.SSH_HOST }}," -e "age_keys=$(sops decrypt secrets/secrets.yaml | grep ^age_secret_key | cut -d ' ' -f 2)"
36+
3237
- name: Login to OpenShift
3338
uses: redhat-actions/oc-login@v1
3439
continue-on-error: true

.github/workflows/plan.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929
- name: Copy SSH area
3030
run: cp -r /root/.ssh /github/home/
3131

32+
- name: Ansible Check
33+
run: |
34+
ansible-galaxy install -r ansible/requirements.yml
35+
ansible-playbook ansible/site.yml -u ${{ secrets.SSH_USER }} -i "${{ secrets.SSH_HOST }}," -e "age_keys=$(sops decrypt secrets/secrets.yaml | grep ^age_secret_key | cut -d ' ' -f 2)" -C --diff
3236
3337
- name: Login to OpenShift
3438
uses: redhat-actions/oc-login@v1
@@ -41,5 +45,6 @@ jobs:
4145

4246
- name: Run tests
4347
run: make test
48+
4449
- name: Terraform plan
4550
run: make plan

Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
SHELL := /bin/bash
2-
CLUSTER_HOST := ltc.makeitwork.cloud
3-
CLUSTER_USER := $(shell sops decrypt secrets/secrets.yaml | grep ^cluster_user | cut -d ' ' -f 2)
4-
SOPS_AGE_KEYS := $(shell sops decrypt secrets/secrets.yaml | grep ^sops_age_key | cut -d ' ' -f 2)
52
OPENSHIFT := $(shell which oc)
63
TERRAFORM := $(shell which terraform)
74
ARGOCD_URL := $(shell sops decrypt secrets/secrets.yaml | grep ^argocd_url | cut -d ' ' -f 2)
@@ -10,7 +7,7 @@ OPENSHIFT_TF_NAMESPACE := $(shell sops decrypt secrets/secrets.yaml | grep ^tf_n
107
CONTEXT := $(shell ${OPENSHIFT} config current-context 2>/dev/null)
118
DESIRED_CONTEXT := $(shell sops decrypt secrets/secrets.yaml | grep ^desired_context | cut -d ' ' -f 2)
129

13-
.PHONY: help init plan apply test pre-commit-check-deps pre-commit-install-hooks argocd-login argocd-password password argocd-sync sync clean
10+
.PHONY: help init plan apply test pre-commit-check-deps pre-commit-install-hooks argocd-login argocd-password password argocd-sync sync clean ansible-init
1411

1512
help:
1613
@echo "General targets"
@@ -46,25 +43,15 @@ init: check-context clean .terraform/terraform.tfstate
4643
@${OPENSHIFT} get project ${OPENSHIFT_TF_NAMESPACE} > /dev/null 2>&1 || ${OPENSHIFT} new-project ${OPENSHIFT_TF_NAMESPACE}
4744
@${TERRAFORM} init -reconfigure -upgrade -input=false -backend-config="host=https://${OPENSHIFT_API_URL}" -backend-config="namespace=${OPENSHIFT_TF_NAMESPACE}"
4845

49-
plan: ansible-check init .terraform/plan
46+
plan: init .terraform/plan
5047

5148
.terraform/plan:
5249
@${TERRAFORM} plan -compact-warnings -out .terraform/plan
5350

54-
ansible-check:
55-
@rm -rf ~/.ansible >/dev/null 2>&1
56-
@ansible-galaxy install -r ansible/requirements.yml
57-
@ansible/site.yml -u ${CLUSTER_USER} -i "${CLUSTER_HOST}," -e 'age_keys=${SOPS_AGE_KEYS}' -C --diff
58-
59-
apply: ansible-init test plan
51+
apply: test plan
6052
@${TERRAFORM} apply -auto-approve -compact-warnings .terraform/plan
6153
@rm -f .terraform/plan
6254

63-
ansible-init:
64-
@rm -rf ~/.ansible >/dev/null 2>&1
65-
@ansible-galaxy install -r ansible/requirements.yml
66-
@ansible/site.yml -u ${CLUSTER_USER} -i "${CLUSTER_HOST}," -e 'age_keys=${SOPS_AGE_KEYS}'
67-
6855
test: check-context .git/hooks/pre-commit
6956
@pre-commit run -a
7057

secrets/secrets.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
openshift_api_url: ENC[AES256_GCM,data:+fFe/tvXfR+0W78MdMWjZ4J/KLA7qXQ4ng==,iv:OwpFUUJu3zOiXvquU/6rojsG9GD0Zn+hZdwhI3pJv4w=,tag:cz3Ojl4DOY4uei0of2DACg==,type:str]
2-
cluster_user: ENC[AES256_GCM,data:YjU91A==,iv:1MonMDleZzhNkoPbIlZuf1KVVyGDFGHWP2tlmGzUDZc=,tag:hd9VzB+87OsBfr20nqnQcw==,type:str]
32
tf_namespace: ENC[AES256_GCM,data:kNXar6grmCbtqg==,iv:PrBsfqMZEMPjWNJs1VPoYFX1WiqwYCD/l1vrO/EziQI=,tag:VBkdXs9YM/9YNJTvyzRhVg==,type:str]
43
desired_context: ENC[AES256_GCM,data:rfR1vvjn393ZFvvdrptjMfItip0Cr+czBkiRa5+Qd05MUpQ=,iv:XU0xK3XxrpiyYf/lwiujzDI+bTEZKvf6YDNQNNHYwbs=,tag:l2xNvvJJrhj6fbGlrnfx7w==,type:str]
54
argocd_url: ENC[AES256_GCM,data:YU9Y5JS5YNs+7ayGtwQn7YOzu5ehVyQEq6+K5X2ZgcXvDDhJP4Cw5KwL3KuM3b99eHA1XU3Ga6fSS+lCpCE=,iv:kGOZqXH1u9IKrxtgHzZsho/8EhNhN3DuajdHPpCOGEY=,tag:7Kc1ISCseYdqkK7jN8DTVA==,type:str]
@@ -15,7 +14,7 @@ sops:
1514
QVpNbjlwSzhsRnJ0cE85YThyUzVieGsK0vfHn0U2NB69RSH8xMOSWhenxaAH8q0D
1615
vwY2mYLvncQ7HpTOuCae6Lx0eBIRdS/O29eRJM0hxklM1v+1EWyTLw==
1716
-----END AGE ENCRYPTED FILE-----
18-
lastmodified: "2025-07-04T21:55:33Z"
19-
mac: ENC[AES256_GCM,data:B74Kyy5xEr//9J4t5umNAocjB/Gzr5EM4+rT/TgzlcaSsnPICo5rHX7dWIwxHDnT29skfKDGHyzvxytsGMzzMrObk0mr7Ypd7Aexb4ERdHjd7eqfpjY/ZOEzRiEGJGr2Sy5bOVLCm0VdMoBsyOYjXi8irt+ruUbhL2fHtA+p7JQ=,iv:QvHxa9jgp61IK9w1aA1Sdgdh+KC5HwgcF9DiKh/MhMQ=,tag:FOx5Uo4gGZk1yoZDCr61+A==,type:str]
17+
lastmodified: "2025-07-04T22:12:42Z"
18+
mac: ENC[AES256_GCM,data:KSAQ5/85esYFfQLRq7rP3cjbdmKoo+nQBZix2v/icZujnuFLXJvbjwIMfqM893C49IZ6rXs2mBpScF+2af/TkgeTguWkGQq12c/xEGx3UveaJdQc+gKlXy/tl2J9aqeGLDp1jtdotjn7Afghps01urd6eosTb+LQPZKqYGXWZP8=,iv:SR+CL1sHimdw2yAm9e4AA7X5Vju29UwvSwfrQvfTXVI=,tag:H/DdMNrHlwWayqk0KMRTWw==,type:str]
2019
unencrypted_suffix: _unencrypted
2120
version: 3.10.2

0 commit comments

Comments
 (0)