-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
35 lines (32 loc) · 1.12 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
stages:
- lint
- check
lint:ansible:
stage: lint
image: quay.io/ansible/toolset
script:
- ansible-lint ansible/
check:playbook:
stage: check
image: quay.io/ansible/ansible-runner:stable-2.9-latest
variables:
ANSIBLE_CONFIG: ansible.cfg
VERIFY_CHECKSUM: "false" # helm installer
before_script:
- mkdir $HOME/.kube
- mv $KUBECONFIG_SECRET $HOME/.kube/config
- chmod 0600 $HOME/.kube/config
- curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- |
cd ansible/
PASSWORD_FILE=$PWD/vault_password
SECRET_FILE=$PWD/vars/ocp-secrets.yml
# create password file
[ ! -f "${PASSWORD_FILE}" ] && (echo changemepassword > $PASSWORD_FILE)
# create secret file from example
[ ! -f "${SECRET_FILE}" ] && ansible-vault encrypt --vault-password-file="${PASSWORD_FILE}" \
"${SECRET_FILE}.example" --output "${SECRET_FILE}"
- pip install -r requirements.txt
- ansible-galaxy collection install -r requirements.yml
script:
- ansible-playbook --check --vault-password-file=vault_password deploy-cluster.yml -e env_name=dev