You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linting ansible roles using the ansible-lint package directly from pypi.
5
5
6
-
Work in Progress...
6
+
Optionally it is possible to install some requirements like ansible collections, roles or pip packages. For more details about it, have a look at the Variables
7
7
8
-
```yml
9
-
inputs:
10
-
target:
11
-
description: |
12
-
Target for ansible linter
13
-
For example './', 'roles/my_role/' or 'site.yml'
14
-
required: true
15
-
required_collections:
16
-
description: |
17
-
You can define a required ansible collection here.
18
-
They will be installed using ansible-galaxy collection install <YourInput>.
19
-
required: false
20
-
required_roles:
21
-
description: |
22
-
You can define a required ansible role here.
23
-
They will be installed using ansible-galaxy role install <YourInput>.
24
-
required: false
25
-
python_dependency:
26
-
description: |
27
-
Install a Python Package using pip
28
-
They will be installed using pip install <YourInput>.
29
-
required: false
30
-
```
8
+
## Usage
31
9
32
-
## Example Setup
10
+
Example of ``.github/workflows/ansible-linting-check.yml``
33
11
```yaml
34
12
---
35
13
name: Ansible Lint check
@@ -51,7 +29,30 @@ jobs:
51
29
fetch-depth: 0
52
30
53
31
- name: Run ansible-lint
54
-
uses: ansible-actions/ansible-lint-action@v0.0.3
32
+
uses: ansible-actions/ansible-lint-action@v0.0.4
33
+
with:
34
+
target: "./"
35
+
```
36
+
37
+
This will run the command ``ansible-lint ./``
38
+
39
+
You can install some reuqirements, example:
40
+
```yml
41
+
[...]
55
42
with:
56
-
target: "site.yml"
43
+
target: "./"
44
+
required_collections: 'community.general'
45
+
python_dependency: 'jmespath'
57
46
```
47
+
*This will install the community.general collections as well as the jmespath pip package.*
48
+
49
+
## Variables
50
+
51
+
| name | required | description | example values |
52
+
| --- | --- | --- | --- |
53
+
| ``target`` | true | Target for ansible linter | ``./`` or ``site.yml`` or ``path/to/ansible/`` |
54
+
| ``required_collections`` | - | define one ansible collection to install | ``community.general`` |
55
+
| ``collections_yml`` | - | define path of yml file for installing multiple ansible collections | ``requirements.yml`` |
56
+
| ``required_roles`` | - | define one ansible role to install | ``namespace.rolename`` |
57
+
| ``python_dependency`` | - | define one pip package to install | ``jmespath`` |
58
+
| ``python_dependency_file`` | - | define path of txt file for installing multiple python packages | ``requirements.txt`` |
0 commit comments