Skip to content

Commit

Permalink
Add ansible-lint sanity test to CI (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored Feb 6, 2024
1 parent 1a9e3ae commit c3f9b51
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 116 deletions.
11 changes: 11 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
profile: production

exclude_paths:
# This file is autogenerated so we cannot change the format
- changelogs/changelog.yaml
# Incorrect error around supported ansible versions in this file
- meta/runtime.yml
- tests/integration/
# We skip a rule that has to be skipped
- tests/sanity/ignore-*.txt
- tests/unit/
2 changes: 2 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ stages:
test: sanity
- name: Units
test: units
- name: Lint
test: lint
- stage: Ansible_2_16
displayName: Ansible 2.16
dependsOn: []
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Collection Docs
concurrency:
group: docs-pr-${{ github.head_ref }}
cancel-in-progress: true
on:
"on":
pull_request_target:
types: [opened, synchronize, reopened, closed]

Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
- name: PR comment
uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main
with:
body-includes: '## Docs Build'
body-includes: "## Docs Build"
reactions: heart
action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }}
on-closed-action: remove
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Collection Docs
concurrency:
group: docs-push-${{ github.sha }}
cancel-in-progress: true
on:
"on":
push:
branches:
- main
tags:
- '*'
- "*"
schedule:
- cron: '0 13 * * *'
- cron: "0 13 * * *"

jobs:
build-docs:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Stale pull request handler
on:
"on":
schedule:
- cron: 0 0 * * *
- cron: 0 0 * * *

permissions:
pull-requests: write
Expand All @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v4.0.0
id: stale
with:
days-before-stale: -1
days-before-pr-stale: 28
days-before-pr-close: 14
stale-pr-label: stale
stale-pr-message: >-
This pull request is stale because it has been open for 4 weeks with no activity.
Remove stale label or comment or this will be closed in 2 weeks.
- uses: actions/stale@v4.0.0
id: stale
with:
days-before-stale: -1
days-before-pr-stale: 28
days-before-pr-close: 14
stale-pr-label: stale
stale-pr-message: >-
This pull request is stale because it has been open for 4 weeks with no activity.
Remove stale label or comment or this will be closed in 2 weeks.
32 changes: 16 additions & 16 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Ansible Windows
trivial_section_name: trivial
2 changes: 1 addition & 1 deletion changelogs/fragments/win_get_url-tls13.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bugfixes:
- win_get_url - Fix Tls1.3 getting removed from the list of security protocols
- win_get_url - Fix Tls1.3 getting removed from the list of security protocols
2 changes: 1 addition & 1 deletion changelogs/fragments/win_powershell-fix-using.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bugfixes:
- win_powershell - Remove unecessary using in code causing stray error records in output - https://github.com/ansible-collections/ansible.windows/issues/571
- win_powershell - Remove unecessary using in code causing stray error records in output - https://github.com/ansible-collections/ansible.windows/issues/571
12 changes: 6 additions & 6 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: windows
version: 2.2.0
readme: README.md
authors:
- Jordan Borean @jborean93
- Matt Davis @nitzmahone
- Jordan Borean @jborean93
- Matt Davis @nitzmahone
description: |
Ansible collection for core Windows plugins.
license_file: COPYING
tags:
- windows
- windows
dependencies: {}
repository: https://github.com/ansible-collections/ansible.windows
documentation: https://docs.ansible.com/ansible/devel/collections/ansible/windows
homepage: https://github.com/ansible-collections/ansible.windows
issues: https://github.com/ansible-collections/ansible.windows/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
build_ignore:
- .vscode
- tests/integration/inventory*
- changelogs/.plugin-cache.yaml
- .vscode
- tests/integration/inventory*
- changelogs/.plugin-cache.yaml
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requires_ansible: '>=2.14'
requires_ansible: ">=2.14"
plugin_routing:
modules:
win_domain_controller:
Expand Down
34 changes: 17 additions & 17 deletions plugins/filter/quote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
DOCUMENTATION:
name: quote
author:
- Jordan Borean (@jborean93)
- Jordan Borean (@jborean93)
short_description: Quotes argument(s) for various Windows shells
seealso:
- module: ansible.windows.win_command
- module: ansible.windows.win_shell
- module: ansible.windows.win_command
- module: ansible.windows.win_shell
description:
- Quotes argument(s) for the various Windows command line shells.
- Defaults to escaping arguments based on the Win32 C argv parsing rules that M(ansible.windows.win_command) uses.
- Using I(shell='cmd') or I(shell='powershell') can be set to escape arguments for those respective shells.
- Each value is escaped in a way to ensure the process gets the literal argument passed in and meta chars escaped.
- Quotes argument(s) for the various Windows command line shells.
- Defaults to escaping arguments based on the Win32 C argv parsing rules that M(ansible.windows.win_command) uses.
- Using I(shell='cmd') or I(shell='powershell') can be set to escape arguments for those respective shells.
- Each value is escaped in a way to ensure the process gets the literal argument passed in and meta chars escaped.
positional: _input
options:
_input:
description:
- The string, list, or dict of values to quote.
- A string or list of strings will be quoted.
- When using a dict as the input, the final form will be in C(KEY="value") to match the MSI parameter format.
- The string, list, or dict of values to quote.
- A string or list of strings will be quoted.
- When using a dict as the input, the final form will be in C(KEY="value") to match the MSI parameter format.
type: raw
required: true
shell:
description:
- The shell to quote the arguments for.
- By default no shell is used and the arguments are quoted with the Win32 C quoting rules.
- The shell to quote the arguments for.
- By default no shell is used and the arguments are quoted with the Win32 C quoting rules.
type: string
choices:
- None
- cmd
- powershell
- None
- cmd
- powershell
default: None

EXAMPLES: |
Expand All @@ -47,5 +47,5 @@ EXAMPLES: |
RETURN:
_value:
description:
- The quoted input value(s) as a single space delimited string.
type: string
- The quoted input value(s) as a single space delimited string.
type: string
18 changes: 9 additions & 9 deletions plugins/modules/async_status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
DOCUMENTATION:
module: async_status
short_description: Obtain status of asynchronous task
seealso:
- module: ansible.builtin.async_status
seealso:
- module: ansible.builtin.async_status
description:
- This module gets the status of an asynchronous task.
- This module gets the status of an asynchronous task.
options:
jid:
description:
- Job or task identifier
- Job or task identifier
type: str
required: true
mode:
description:
- If C(status), obtain the status.
- If C(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job I(jid).
- If C(status), obtain the status.
- If C(cleanup), clean up the async job cache (by default in C(~/.ansible_async/)) for the specified job I(jid).
type: str
choices: [ cleanup, status ]
choices: [cleanup, status]
default: status
author:
- Ansible Core Team
- Ansible Core Team

EXAMPLES: |
- name: Asynchronous yum task
Expand All @@ -44,7 +44,7 @@ RETURN:
description: The asynchronous job id
returned: success
type: str
sample: '360874038559.4169'
sample: "360874038559.4169"
finished:
description: Whether the asynchronous job has finished (C(1)) or not (C(0))
returned: always
Expand Down
54 changes: 27 additions & 27 deletions plugins/modules/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@ DOCUMENTATION:
module: setup
short_description: Gathers facts about remote hosts
seealso:
- module: ansible.builtin.setup
- module: ansible.builtin.setup
options:
gather_subset:
description:
- If supplied, restrict the additional facts collected to the given subset.
- Can specify a list of values to specify a larger subset.
- Values can also be used with an initial C(!) to specify that that specific subset should not be collected.
- To avoid collecting even the min subset, specify C(!all,!min).
- To collect only specific facts, use C(!all,!min), and specify the particular fact subsets.
- If supplied, restrict the additional facts collected to the given subset.
- Can specify a list of values to specify a larger subset.
- Values can also be used with an initial C(!) to specify that that specific subset should not be collected.
- To avoid collecting even the min subset, specify C(!all,!min).
- To collect only specific facts, use C(!all,!min), and specify the particular fact subsets.
type: list
elements: str
default: all
gather_timeout:
description:
- Set the default timeout in seconds for individual fact gathering.
- Set the default timeout in seconds for individual fact gathering.
type: int
default: 10
fact_path:
description:
- Path used for local ansible facts (C(*.ps1) or C(*.json)) - files in this dir
will be run (if a ps1) or read (if a json) and their results be added to the return facts.
- The returned fact will be named after the local file (without the extension suffix), e.g. C(ansible_my_fact).
- Path used for local ansible facts (C(*.ps1) or C(*.json)) - files in this dir
will be run (if a ps1) or read (if a json) and their results be added to the return facts.
- The returned fact will be named after the local file (without the extension suffix), e.g. C(ansible_my_fact).
type: path
_measure_subset:
description:
- For internal use
- For internal use
type: bool
default: False
default: false
description:
- This module is automatically called by playbooks to gather useful
variables about remote hosts that can be used in playbooks. It can also be
executed directly by C(/usr/bin/ansible) to check what variables are
available to a host. Ansible provides many I(facts) about the system,
automatically.
- This module is automatically called by playbooks to gather useful
variables about remote hosts that can be used in playbooks. It can also be
executed directly by C(/usr/bin/ansible) to check what variables are
available to a host. Ansible provides many I(facts) about the system,
automatically.
notes:
- More ansible facts will be added with successive releases. If I(facter) is
installed, variables from these programs will also be snapshotted
into the JSON file for usage in templating. These variables are prefixed
with C(facter_) so it's easy to tell their source. All variables are
bubbled up to the caller.
- Some facts may be unavailable if running under a limited account.
- For more information about delegated facts,
please check U(https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-facts).
- More ansible facts will be added with successive releases. If I(facter) is
installed, variables from these programs will also be snapshotted
into the JSON file for usage in templating. These variables are prefixed
with C(facter_) so it's easy to tell their source. All variables are
bubbled up to the caller.
- Some facts may be unavailable if running under a limited account.
- For more information about delegated facts,
please check U(https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-facts).
author:
- Ansible Core Team
- Ansible Core Team

EXAMPLES: |
- name: run the setup facts
ansible.builtin.setup:
ansible.builtin.setup:
Loading

0 comments on commit c3f9b51

Please sign in to comment.