-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (29 loc) · 1.02 KB
/
ansible.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
---
name: Ansible
on: [push]
# From https://dev.to/koh_sh/automatic-ansible-lint-with-github-actions-52oe
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.12']
ansible-version: [9.1.0]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Ansible ${{ matrix.ansible-version }}
run: |
python -m pip install --upgrade pip
pip install yamllint ansible==${{ matrix.ansible-version }}
- name: Lint playbook
run: |
ansible-galaxy role install -r requirements.yml
ansible-galaxy collection install -r requirements.yml
ansible-playbook playbooks/dell/main.yaml --syntax-check
ansible-playbook playbooks/gop/main.yml --syntax-check
yamllint .