generated from edwardtheharris/ansible-template
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.27 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
###
# ```{rubric} Ansible Lint Jobs
# ```
# ---
# This action lints Ansible code for quality.
#
# ```{literalinclude} .github/workflows/ansible-lint.yml
# :language: yaml
# :caption: .github/workflows/ansible-lint.yml
# ```
name: ansible-lint
on:
pull_request:
branches: ["main", "stable", "release/v*"]
push:
branches:
- main
workflow_dispatch:
jobs:
build:
###
# Naming the build is important to use it as a status check
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: 3.12
- name: Install requirements
run: |
python3 -m venv .venv
.venv/bin/pip3 install pipenv
.venv/bin/pipenv requirements --dev > reqs
python3 -m pip install -r reqs
ansible-galaxy collection install community.crypto
- name: Make ansible directory
run: |
sudo mkdir -pv /etc/ansible
SUSER=$(whoami)
sudo chown ${SUSER} /etc/ansible
touch /etc/ansible/vault
echo "Pass" > /etc/ansible/vault
- name: Run ansible-lint
###
# or version tag instead of 'main'
uses: ansible/ansible-lint@main