-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sscheib/ft-ansible_lint_github_workflow
Ft ansible lint GitHub workflow
- Loading branch information
Showing
20 changed files
with
277 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
enable_list: | ||
- 'args' | ||
- 'empty-string-compare' | ||
- 'no-log-password' | ||
- 'no-same-owner' | ||
- 'name[prefix]' | ||
|
||
kinds: | ||
- yaml: '.ansible-lint' | ||
- yaml: '.github/workflows/ansible-lint.yml' | ||
- yaml: '.pre-commit-config.yaml' | ||
- yaml: '.yamllint' | ||
- yaml: '**/*.{yml,yaml}' | ||
|
||
loop_var_prefix: '^(__|{role}_)' | ||
max_block_depth: 20 | ||
offline: true | ||
profile: 'production' | ||
skip_action_validation: false | ||
skip_list: [] | ||
task_name_prefix: '{stem} | ' | ||
use_default_rules: true | ||
var_naming_pattern: '^[a-z_][a-z0-9_]*$' | ||
warn_list: | ||
- 'experimental' | ||
write_list: | ||
- 'none' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: 'Publish latest release to Ansible Galaxy' | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
build: | ||
name: 'Publish to Ansible Galaxy' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: 'checkout' | ||
uses: 'actions/checkout@v2' | ||
- name: 'galaxy' | ||
uses: 'robertdebock/galaxy-action@1.2.0' | ||
with: | ||
galaxy_api_key: '${{ secrets.galaxy_api_key }}' | ||
git_branch: 'main' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: 'ansible-lint' | ||
on: | ||
pull_request: | ||
branches: ['main'] | ||
workflow_dispatch: {} | ||
jobs: | ||
build: | ||
name: 'Ansible Lint' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: 'actions/checkout@v4' | ||
- name: 'Run ansible-lint' | ||
uses: 'ansible/ansible-lint@main' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
repos: | ||
- repo: 'https://github.com/ansible/ansible-lint' | ||
rev: 'v6.20.3' | ||
hooks: | ||
- name: 'Ansible-lint' | ||
additional_dependencies: | ||
# https://github.com/pre-commit/pre-commit/issues/1526 | ||
# If you want to use specific version of ansible-core or ansible, feel | ||
# free to override `additional_dependencies` in your own hook config | ||
# file. | ||
- 'ansible-core>=2.15' | ||
always_run: true | ||
description: 'This hook runs ansible-lint.' | ||
entry: 'python3 -m ansiblelint -v --force-color' | ||
id: 'ansible-lint' | ||
language: 'python' | ||
# do not pass files to ansible-lint, see: | ||
# https://github.com/ansible/ansible-lint/issues/611 | ||
pass_filenames: false | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,45 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
extends: 'default' | ||
|
||
rules: | ||
braces: | ||
level: 'error' | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
level: 'error' | ||
max-spaces-inside: 1 | ||
level: error | ||
colons: | ||
level: 'error' | ||
max-spaces-after: -1 | ||
level: error | ||
commas: | ||
level: 'error' | ||
max-spaces-after: -1 | ||
level: error | ||
comments: enable | ||
comments-indentation: enable | ||
document-start: enable | ||
comments: 'enable' | ||
comments-indentation: 'enable' | ||
document-end: 'enable' | ||
document-start: 'enable' | ||
empty-lines: | ||
level: 'error' | ||
max: 3 | ||
level: error | ||
hyphens: | ||
level: error | ||
indentation: enable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: enable | ||
empty-values: 'enable' | ||
float-values: 'enable' | ||
hyphens: 'enable' | ||
indentation: 'enable' | ||
key-duplicates: 'enable' | ||
key-ordering: 'disable' | ||
line-length: | ||
max: 120 | ||
new-line-at-end-of-file: 'enable' | ||
new-lines: | ||
type: unix | ||
trailing-spaces: enable | ||
truthy: enable | ||
type: 'unix' | ||
octal-values: 'enable' | ||
quoted-strings: 'enable' | ||
trailing-spaces: 'enable' | ||
truthy: 'enable' | ||
|
||
yaml-files: | ||
- '*.yaml' | ||
- '*.yml' | ||
- '.yamllint' | ||
- '.ansible.lint' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
collections: | ||
- name: 'ansible.posix' | ||
version: '>=1.5.4' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,3 +106,4 @@ _def_post_sections: | |
|
||
- name: 'Autorelabel' | ||
template: 'post__autorelabel.j2' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.