2020-05-10 01:14:04 +02:00
|
|
|
image: "archlinux:latest"
|
|
|
|
|
|
|
|
before_script:
|
2021-03-16 01:30:31 +01:00
|
|
|
- pacman -Syu --needed --noconfirm ansible-lint ansible yamllint terraform
|
2020-05-10 01:14:04 +02:00
|
|
|
|
|
|
|
ansible-lint:
|
|
|
|
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)
|
|
|
|
- sed "s/,hcloud_inventory.py//" -i ansible.cfg
|
|
|
|
- sed "/^vault_password_file/d" -i ansible.cfg
|
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:
|
|
|
|
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
|