2020-05-10 01:14:04 +02:00
|
|
|
image: "archlinux:latest"
|
|
|
|
|
|
|
|
ansible-lint:
|
2022-04-05 09:48:48 +02:00
|
|
|
before_script:
|
2022-09-18 23:06:37 +02:00
|
|
|
- pacman -Syu --needed --noconfirm ansible-lint ansible python-jmespath
|
2020-05-10 01:14:04 +02:00
|
|
|
script:
|
2020-05-10 02:25:07 +02:00
|
|
|
# Fix weird ansible bug: https://github.com/trailofbits/algo/issues/1637
|
2020-05-10 02:20:26 +02:00
|
|
|
# This probably happens due to gitlab-runner mounting the git repo into the container
|
2020-05-10 01:14:04 +02:00
|
|
|
- chmod o-w .
|
2021-02-14 12:24:33 +01:00
|
|
|
# Fix syntax-check rule (https://github.com/ansible-community/ansible-lint/issues/1350#issuecomment-778764110)
|
2022-05-21 14:47:16 +02:00
|
|
|
- sed -i "/^vault_identity_list/d" ansible.cfg
|
|
|
|
- sed -i -e "/vars_files:/d" -e "/misc\/vaults\/vault_/d" playbooks/*.yml
|
2021-02-14 14:05:32 +01:00
|
|
|
# Fix load-failure: Failed to load or parse file
|
|
|
|
- ansible-lint $(printf -- "--exclude %s " */*/vault_*)
|
2020-05-10 02:36:58 +02:00
|
|
|
|
|
|
|
terraform-validate:
|
2022-04-05 09:48:48 +02:00
|
|
|
before_script:
|
|
|
|
- pacman -Syu --needed --noconfirm terraform diffutils
|
2020-05-10 02:36:58 +02:00
|
|
|
script:
|
|
|
|
- cd tf-stage1
|
|
|
|
- terraform init -backend=false
|
|
|
|
- terraform validate
|
2020-10-21 20:14:43 +02:00
|
|
|
- terraform fmt --check
|
2020-05-10 02:36:58 +02:00
|
|
|
- cd ../tf-stage2
|
|
|
|
- terraform init -backend=false
|
|
|
|
- terraform validate
|
2021-01-13 17:43:02 +01:00
|
|
|
- terraform fmt --check --diff
|