Skip to content

Instantly share code, notes, and snippets.

@deekayen
Created October 22, 2020 02:34
Show Gist options
  • Save deekayen/f73cdbfd6a10179e5a6ee817dd8e5057 to your computer and use it in GitHub Desktop.
Save deekayen/f73cdbfd6a10179e5a6ee817dd8e5057 to your computer and use it in GitHub Desktop.
Lint Ansible using GitLab Runners in kubernetes.
---
default:
image:
name: cytopia/ansible:latest-tools
entrypoint: ["/bin/sh", "-c"]
tags:
- kubernetes
ansible-lint:
image:
name: cytopia/ansible-lint:latest
entrypoint: ["/bin/sh", "-c"]
script:
- ansible-lint --version
- ansible-lint --exclude=/home/gitlab-runner/.ansible/roles .
tags:
- kubernetes
syntax-check:
image:
name: cytopia/ansible:latest-tools
entrypoint: ["/bin/sh", "-c"]
script:
- ansible-galaxy --version
- ansible-playbook --version
- ansible-galaxy collection install --force -r collections/requirements.yml
- ansible-galaxy role install --force -r roles/requirements.yml
- ls -1 *.yml | xargs ansible-playbook --syntax-check --list-tasks --vault-password-file=$VAULT_KEY -i 127.0.0.1,
tags:
- kubernetes
yamllint:
image:
name: cytopia/yamllint
entrypoint: ["/bin/ash", "-c"]
script:
- yamllint --version
- yamllint .
tags:
- kubernetes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment