-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (56 loc) · 1.61 KB
/
ansiblelint.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
name: Ansible lint
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
env:
ANSIBLE_FORCE_COLOR: 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# pip has issue
#python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Show environment
run: |
ansible --version
yamllint --version
flake8 --version
ansible-lint --version
# checks before external roles
- name: Test with yamllint
run: |
yamllint .
- name: Test with flake8
run: |
flake8 --exclude=plugins/strategy/mitogen_linear.py .
- name: Install Ansible roles
run: |
ansible-galaxy install -r requirements.yml
- name: Run Ansible lint
run: |
export EXT_ROLES_DIRS=$(find . -mindepth 2 -name ".galaxy_install_info" -printf "%h " | xargs -n 1 dirname)
ansible-lint -p --nocolor $(echo ${EXT_ROLES_DIRS} | sed -r 's/\./--exclude=\./g') playbooks
- name: Remove secrets
run: |
find . -name '*.vault.*' -delete
- name: Check syntax
run: |
find playbooks/ -maxdepth 1 -name '*.yml' | xargs -n 1 ansible-playbook --syntax-check