summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /examples
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples')
l---------examples/.config/ansible-lint.yml1
-rw-r--r--examples/.config/molecule/config.yml0
-rw-r--r--examples/Taskfile.yml8
-rw-r--r--examples/ansible-navigator.yml3
-rw-r--r--examples/broken/.ansible-lint2
-rw-r--r--examples/broken/ansible-navigator.yml3
-rw-r--r--examples/broken/encoding.j21
-rw-r--r--examples/broken/encoding.ymlbin0 -> 1001 bytes
-rw-r--r--examples/broken/yaml-with-tabs/invalid-due-tabs.yaml4
-rw-r--r--examples/broken_collection_meta_runtime/meta/runtime.yml2
-rw-r--r--examples/changelogs/changelog.yaml2
-rw-r--r--examples/collection/CHANGELOG.rst0
-rw-r--r--examples/collection/galaxy.yml17
-rw-r--r--examples/collection/meta/runtime.yml0
-rw-r--r--examples/collection/plugins/modules/alpha.py44
-rw-r--r--examples/collection/plugins/modules/deep/beta.py44
-rw-r--r--examples/ee_broken/execution-environment.yml3
-rw-r--r--examples/execution-environment.yml4
-rw-r--r--examples/galaxy_no_required_tags/fail/changelogs/changelog.yaml2
-rw-r--r--examples/galaxy_no_required_tags/fail/galaxy.yml11
-rw-r--r--examples/galaxy_no_required_tags/fail/meta/runtime.yml0
-rw-r--r--examples/galaxy_no_required_tags/pass/changelogs/changelog.yaml2
-rw-r--r--examples/galaxy_no_required_tags/pass/galaxy.yml12
-rw-r--r--examples/galaxy_no_required_tags/pass/meta/runtime.yml0
-rw-r--r--examples/group_vars/all.yml2
-rw-r--r--examples/host_vars/localhost.yml2
-rw-r--r--examples/inventory/broken_dev_inventory.yml3
-rw-r--r--examples/inventory/inventory.yml31
-rw-r--r--examples/inventory/production.yml38
-rw-r--r--examples/lineno.yml3
-rw-r--r--examples/meta/changelogs/changelog.yaml2
-rw-r--r--examples/meta/galaxy.yml15
-rw-r--r--examples/meta/meta/runtime.yml0
-rw-r--r--examples/meta/runtime.yml3
-rw-r--r--examples/meta_runtime_version_checks/fail_0/meta/runtime.yml2
-rw-r--r--examples/meta_runtime_version_checks/fail_1/meta/runtime.yml2
-rw-r--r--examples/meta_runtime_version_checks/fail_2/meta/runtime.yml2
-rw-r--r--examples/meta_runtime_version_checks/pass/meta/runtime.yml2
-rw-r--r--examples/no_changelog/galaxy.yml17
-rw-r--r--examples/no_changelog/meta/runtime.yml0
-rw-r--r--examples/no_collection_version/changelogs/changelog.yaml2
-rw-r--r--examples/no_collection_version/galaxy.yml14
-rw-r--r--examples/other/guess-1.yml3
-rw-r--r--examples/other/some.j2.yaml2
-rw-r--r--examples/other/some.yaml-too1
-rw-r--r--examples/playbooks/.ansible-lint-only-builtins-allow13
-rw-r--r--examples/playbooks/README.md2
-rw-r--r--examples/playbooks/always-run-success.yml2
-rw-r--r--examples/playbooks/become.transformed.yml15
-rw-r--r--examples/playbooks/become.yml15
-rw-r--r--examples/playbooks/block.yml26
-rw-r--r--examples/playbooks/blockincludes.yml21
-rw-r--r--examples/playbooks/blockincludes2.yml18
-rw-r--r--examples/playbooks/bracketsmatchtest.yml4
-rw-r--r--examples/playbooks/bug-core-warning-unique-filter-fallback.yml11
-rw-r--r--examples/playbooks/capture-warning.yml8
-rw-r--r--examples/playbooks/collections/.gitignore2
-rw-r--r--examples/playbooks/command-check-failure.yml13
-rw-r--r--examples/playbooks/command-check-success.yml63
-rw-r--r--examples/playbooks/common-include-1.yml10
-rw-r--r--examples/playbooks/common-include-2.yml7
-rw-r--r--examples/playbooks/conflicting_action.yml12
-rw-r--r--examples/playbooks/contains_secrets.transformed.yml18
-rw-r--r--examples/playbooks/contains_secrets.yml18
-rw-r--r--examples/playbooks/custom_module.yml9
-rw-r--r--examples/playbooks/deep/empty.yml4
-rw-r--r--examples/playbooks/ematcher-rule.yml13
-rw-r--r--examples/playbooks/empty_playbook.yml3
-rw-r--r--examples/playbooks/example.yml49
-rw-r--r--examples/playbooks/extra_vars.yml10
-rw-r--r--examples/playbooks/find_children.yml10
-rw-r--r--examples/playbooks/fqcn.transformed.yml16
-rw-r--r--examples/playbooks/fqcn.yml16
-rw-r--r--examples/playbooks/handlers/included-handlers.yml6
-rw-r--r--examples/playbooks/handlers/y.yml3
-rw-r--r--examples/playbooks/include-import-tasks-in-role.yml5
-rw-r--r--examples/playbooks/include-in-block.yml6
-rw-r--r--examples/playbooks/include.yml18
-rw-r--r--examples/playbooks/jinja-spacing.yml89
-rw-r--r--examples/playbooks/json-schema-fail.yml4
-rw-r--r--examples/playbooks/lots_of_warnings.transformed.yml1000
-rw-r--r--examples/playbooks/lots_of_warnings.yml1000
-rw-r--r--examples/playbooks/mocked_dependency.yml10
-rw-r--r--examples/playbooks/multiline-brackets-do-not-match-test.yml22
-rw-r--r--examples/playbooks/multiline-bracketsmatchtest.yml22
-rw-r--r--examples/playbooks/name-case.transformed.yml4
-rw-r--r--examples/playbooks/name-case.yml4
-rw-r--r--examples/playbooks/no_handler_fail.yml27
-rw-r--r--examples/playbooks/no_handler_pass.yml84
-rw-r--r--examples/playbooks/no_relative_paths_fail.yml23
-rw-r--r--examples/playbooks/no_relative_paths_pass.yml14
-rw-r--r--examples/playbooks/nomatches.yml9
-rw-r--r--examples/playbooks/nomatchestest.transformed.yml9
-rw-r--r--examples/playbooks/nomatchestest.yml9
-rw-r--r--examples/playbooks/noqa-nested.yml9
-rw-r--r--examples/playbooks/noqa.yml6
-rw-r--r--examples/playbooks/norole.yml5
-rw-r--r--examples/playbooks/norole2.yml5
-rw-r--r--examples/playbooks/package-check-failure.yml21
-rw-r--r--examples/playbooks/package-check-success.yml22
-rw-r--r--examples/playbooks/pass-loop-var-prefix.yml18
-rw-r--r--examples/playbooks/play-without-extension2
-rw-r--r--examples/playbooks/play.yml6
-rw-r--r--examples/playbooks/play_miss_include.yml5
-rw-r--r--examples/playbooks/playbook-imported.yml11
-rw-r--r--examples/playbooks/playbook-parent.yml9
l---------examples/playbooks/roles1
-rw-r--r--examples/playbooks/rule-args-module-fail.yml37
-rw-r--r--examples/playbooks/rule-args-module-pass.yml97
-rw-r--r--examples/playbooks/rule-avoid-implicit-fail.yml9
-rw-r--r--examples/playbooks/rule-avoid-implicit-pass.yml9
-rw-r--r--examples/playbooks/rule-command-instead-of-module-fail.yml15
-rw-r--r--examples/playbooks/rule-command-instead-of-module-pass.yml37
-rw-r--r--examples/playbooks/rule-command-instead-of-shell-fail.yml25
-rw-r--r--examples/playbooks/rule-command-instead-of-shell-pass.yml60
-rw-r--r--examples/playbooks/rule-deprecated-bare-vars-fail.yml97
-rw-r--r--examples/playbooks/rule-deprecated-bare-vars-pass.yml168
-rw-r--r--examples/playbooks/rule-deprecated-command-syntax.yml7
-rw-r--r--examples/playbooks/rule-deprecated-local-action-fail.yml7
-rw-r--r--examples/playbooks/rule-empty-string-compare-fail.yml16
-rw-r--r--examples/playbooks/rule-empty-string-compare-pass.yml16
-rw-r--r--examples/playbooks/rule-fqcn-fail.yml14
-rw-r--r--examples/playbooks/rule-fqcn-pass.yml13
-rw-r--r--examples/playbooks/rule-jinja-fail.yml12
-rw-r--r--examples/playbooks/rule-jinja-pass.yml83
-rw-r--r--examples/playbooks/rule-key-order-fail.yml30
-rw-r--r--examples/playbooks/rule-key-order-pass.yml16
-rw-r--r--examples/playbooks/rule-name-casing.yml10
-rw-r--r--examples/playbooks/rule-name-missing-fail.yml11
-rw-r--r--examples/playbooks/rule-name-missing-pass.yml12
-rw-r--r--examples/playbooks/rule-name-play-fail.yml3
-rw-r--r--examples/playbooks/rule-name-templated-fail.yml13
-rw-r--r--examples/playbooks/rule-no-changed-when-fail.yml15
-rw-r--r--examples/playbooks/rule-no-changed-when-pass.yml23
-rw-r--r--examples/playbooks/rule-no-free-form-fail.yml14
-rw-r--r--examples/playbooks/rule-no-free-form-pass.yml19
-rw-r--r--examples/playbooks/rule-no-handler-fail.yml15
-rw-r--r--examples/playbooks/rule-no-handler-pass.yml15
-rw-r--r--examples/playbooks/rule-no-jinja-when-fail.yml21
-rw-r--r--examples/playbooks/rule-no-jinja-when-pass.yml17
-rw-r--r--examples/playbooks/rule-no-prompting.yml27
-rw-r--r--examples/playbooks/rule-no-tabs.yml20
-rw-r--r--examples/playbooks/rule-only-builtins.yml12
-rw-r--r--examples/playbooks/rule-partial-become-without-become-fail.yml28
-rw-r--r--examples/playbooks/rule-partial-become-without-become-pass.yml35
-rw-r--r--examples/playbooks/rule-risky-file-permissions-fail.yml91
-rw-r--r--examples/playbooks/rule-risky-file-permissions-pass.yml77
-rw-r--r--examples/playbooks/rule-risky-octal-fail.yml25
-rw-r--r--examples/playbooks/rule-risky-octal-pass.yml42
-rw-r--r--examples/playbooks/rule-risky-shell-pipe-fail.yml17
-rw-r--r--examples/playbooks/rule-risky-shell-pipe-pass.yml70
-rw-r--r--examples/playbooks/rule-role-name-path.yml10
-rw-r--r--examples/playbooks/rule-schema-become-method-fail.yml10
-rw-r--r--examples/playbooks/rule-schema-become-method-pass.yml5
-rw-r--r--examples/playbooks/rule-syntax-moves.yml16
-rw-r--r--examples/playbooks/rule-validate-module-options-pass-2.yml10
-rw-r--r--examples/playbooks/rule-var-naming-fail.yml32
-rw-r--r--examples/playbooks/rule-yaml-fail.yml18
-rw-r--r--examples/playbooks/rule-yaml-pass.yml7
-rw-r--r--examples/playbooks/rule_literal_compare_fail.yml19
-rw-r--r--examples/playbooks/rule_literal_compare_pass.yml25
-rw-r--r--examples/playbooks/rulebook.yml21
-rw-r--r--examples/playbooks/run-once-fail.yml12
-rw-r--r--examples/playbooks/run-once-pass.yml8
-rw-r--r--examples/playbooks/schema-error-string.yml4
-rw-r--r--examples/playbooks/skiptasks.yml64
-rw-r--r--examples/playbooks/strict-mode.yml8
-rw-r--r--examples/playbooks/syntax-error-string.yml7
-rw-r--r--examples/playbooks/syntax-error.yml6
-rw-r--r--examples/playbooks/task_in_list-0.yml28
-rw-r--r--examples/playbooks/taskimports.yml16
-rw-r--r--examples/playbooks/taskincludes.yml11
-rw-r--r--examples/playbooks/tasks/bug-2875.yml9
-rw-r--r--examples/playbooks/tasks/conflicting-action-statements.yml3
-rw-r--r--examples/playbooks/tasks/directory with spaces/main.yml4
-rw-r--r--examples/playbooks/tasks/empty_blocks.yml17
-rw-r--r--examples/playbooks/tasks/include-in-block-inner.yml5
-rw-r--r--examples/playbooks/tasks/included-task-with-vars.yml4
-rw-r--r--examples/playbooks/tasks/included-with-lint.yml4
-rw-r--r--examples/playbooks/tasks/malformed.yml3
-rw-r--r--examples/playbooks/tasks/nestedincludes.yml3
-rw-r--r--examples/playbooks/tasks/passing_task.yml4
-rw-r--r--examples/playbooks/tasks/rule-name-prefix-fail.yml13
-rw-r--r--examples/playbooks/tasks/simple_task.yml4
-rw-r--r--examples/playbooks/tasks/vars/bug-3289.yml2
-rw-r--r--examples/playbooks/tasks/varset.yml4
-rw-r--r--examples/playbooks/tasks/varunset.yml2
-rw-r--r--examples/playbooks/tasks/x.yml7
-rw-r--r--examples/playbooks/templates/not-valid.yaml2
-rw-r--r--examples/playbooks/test_import_with_conflicting_action_statements.yml4
-rw-r--r--examples/playbooks/test_import_with_malformed.yml4
-rw-r--r--examples/playbooks/test_include_inplace.yml5
-rw-r--r--examples/playbooks/test_include_relative.yml6
-rw-r--r--examples/playbooks/test_skip_inside_yaml.yml64
-rw-r--r--examples/playbooks/unicode.transformed.yml8
-rw-r--r--examples/playbooks/unicode.yml8
-rw-r--r--examples/playbooks/valid.yml4
-rw-r--r--examples/playbooks/valid_with_alt_extension.yaml7
-rw-r--r--examples/playbooks/vars/empty.transformed.yml3
-rw-r--r--examples/playbooks/vars/empty.yml3
-rw-r--r--examples/playbooks/vars/empty_vars.transformed.yml2
-rw-r--r--examples/playbooks/vars/empty_vars.yml2
-rw-r--r--examples/playbooks/vars/invalid_vars_schema.yml2
-rw-r--r--examples/playbooks/vars/jinja-spacing.yml41
-rw-r--r--examples/playbooks/vars/other.yml2
-rw-r--r--examples/playbooks/vars/rule_jinja_vars.yml5
-rw-r--r--examples/playbooks/vars/rule_var_naming_fail.yml14
-rw-r--r--examples/playbooks/vars/strings.transformed.yml39
-rw-r--r--examples/playbooks/vars/strings.yml45
-rw-r--r--examples/playbooks/vars/subfolder/settings.yml2
-rw-r--r--examples/playbooks/vars/vault_full.yml11
-rw-r--r--examples/playbooks/vars/vault_partial.yml8
-rw-r--r--examples/playbooks/warning-from-module.yml11
-rw-r--r--examples/playbooks/with-skip-tag-id.yml7
-rw-r--r--examples/playbooks/with-umlaut-ä.yml5
-rw-r--r--examples/reqs_v1/requirements.yml10
-rw-r--r--examples/reqs_v2/requirements.yml8
-rw-r--r--examples/roles/ansible-role-foo/tasks/main.yaml0
-rw-r--r--examples/roles/bobbins/tasks/imported_tasks.yml0
-rw-r--r--examples/roles/bobbins/tasks/main.yml7
-rw-r--r--examples/roles/broken_argument_specs/meta/argument_specs.yml5
-rw-r--r--examples/roles/dependency_in_meta/meta/main.yml42
-rw-r--r--examples/roles/fixture_1/tasks/main.yml21
-rw-r--r--examples/roles/foo.yml0
-rw-r--r--examples/roles/hello/meta/argument_specs.yml27
-rw-r--r--examples/roles/hello/meta/main.yml3
-rw-r--r--examples/roles/include_in_the_place/tasks/included_file.yml4
-rw-r--r--examples/roles/include_in_the_place/tasks/main.yml3
-rw-r--r--examples/roles/include_miss/tasks/main.yml3
-rw-r--r--examples/roles/include_relative/tasks/included_file.yml4
-rw-r--r--examples/roles/include_relative/tasks/main.yml7
-rw-r--r--examples/roles/invalid-name/tasks/main.yaml4
-rw-r--r--examples/roles/invalid_due_syntax/tasks/main.yml2
-rw-r--r--examples/roles/invalid_due_to_meta/meta/main.yml10
-rw-r--r--examples/roles/invalid_due_to_meta/tasks/main.yaml0
-rw-r--r--examples/roles/invalid_meta_schema/meta/main.yml9
-rw-r--r--examples/roles/invalid_requirements_schema/meta/requirements.yml3
-rw-r--r--examples/roles/invalud_meta_schema0
-rw-r--r--examples/roles/loop_var_prefix/tasks/fail.yml46
-rw-r--r--examples/roles/loop_var_prefix/tasks/pass.yml30
-rw-r--r--examples/roles/meta_categories_as_list/meta/main.yml4
-rw-r--r--examples/roles/meta_incorrect_fail/meta/main.yml12
-rw-r--r--examples/roles/meta_no_tags_galaxy_info/meta/main.yml2
-rw-r--r--examples/roles/meta_no_tags_valid/meta/main.yml4
-rw-r--r--examples/roles/meta_noqa/meta/main.yml8
-rw-r--r--examples/roles/meta_tags_no_list/meta/main.yml3
-rw-r--r--examples/roles/meta_tags_not_a_string/meta/main.yml4
-rw-r--r--examples/roles/meta_video_links_fail/meta/main.yml27
-rw-r--r--examples/roles/meta_video_links_pass/meta/main.yml13
-rw-r--r--examples/roles/more_complex/handlers/main.yml3
-rw-r--r--examples/roles/more_complex/tasks/main.yml9
-rw-r--r--examples/roles/role_for_no_same_owner/tasks/fail.yml77
-rw-r--r--examples/roles/role_for_no_same_owner/tasks/pass.yml32
-rw-r--r--examples/roles/role_with_task_inclusions/tasks/imported_tasks.yml3
-rw-r--r--examples/roles/role_with_task_inclusions/tasks/included_tasks.yml3
-rw-r--r--examples/roles/role_with_task_inclusions/tasks/main.yml10
-rw-r--r--examples/roles/subfolder/1st_role/tasks/main.yml0
-rw-r--r--examples/roles/subfolder/2nd_role/tasks/main.yml0
-rw-r--r--examples/roles/subfolder/3rd_role/tasks/main.yml0
-rw-r--r--examples/roles/subfolder/other_role/tasks/main.yml4
-rw-r--r--examples/roles/template_lookup/files/a_file0
-rw-r--r--examples/roles/template_lookup/tasks/main.yml10
-rw-r--r--examples/roles/template_lookup_missing/tasks/main.yml7
-rw-r--r--examples/roles/test-role/meta/requirements.yml3
-rw-r--r--examples/roles/test-role/molecule/default/include-import-role.yml6
-rw-r--r--examples/roles/test-role/tasks/main.yml4
-rw-r--r--examples/roles/test-role/tasks/world.yml3
-rw-r--r--examples/roles/valid-due-to-meta/meta/main.yml10
-rw-r--r--examples/roles/valid-due-to-meta/tasks/debian/main.yml2
-rw-r--r--examples/roles/valid-due-to-meta/tasks/main.yaml0
-rw-r--r--examples/roles/var_naming_pattern/.ansible-lint2
-rw-r--r--examples/roles/var_naming_pattern/tasks/cacheable_set_fact.yml5
-rw-r--r--examples/roles/var_naming_pattern/tasks/include_task_with_vars.yml13
-rw-r--r--examples/roles/var_naming_pattern/tasks/main.yml4
-rw-r--r--examples/rulebooks/rulebook-fail.yml21
-rw-r--r--examples/rulebooks/rulebook-pass.yml15
-rw-r--r--examples/rules/task_has_tag.py44
-rw-r--r--examples/sanity_ignores/tests/sanity/ignore-2.13.txt1
-rw-r--r--examples/sanity_ignores/tests/sanity/ignore-2.15.txt2
-rw-r--r--examples/sanity_ignores/tests/sanity/ignore-2.9.txt2
-rw-r--r--examples/site.yml4
-rw-r--r--examples/templates/playbooks/playbook.yml6
-rw-r--r--examples/test_collection/README.md3
-rw-r--r--examples/test_collection/galaxy.yml67
-rw-r--r--examples/test_collection/roles/my_role/tasks/main.yml13
-rw-r--r--examples/test_collection/roles/my_role2/tasks/main.yml4
-rw-r--r--examples/testproject/roles/test-role/tasks/main.yml3
-rw-r--r--examples/yamllint/invalid.yml9
-rw-r--r--examples/yamllint/line-length.yml4
-rw-r--r--examples/yamllint/multi-document.yaml4
-rw-r--r--examples/yamllint/skipped-rule.yml3
-rw-r--r--examples/yamllint/valid.yml0
292 files changed, 6086 insertions, 0 deletions
diff --git a/examples/.config/ansible-lint.yml b/examples/.config/ansible-lint.yml
new file mode 120000
index 0000000..3da8d98
--- /dev/null
+++ b/examples/.config/ansible-lint.yml
@@ -0,0 +1 @@
+../../.ansible-lint \ No newline at end of file
diff --git a/examples/.config/molecule/config.yml b/examples/.config/molecule/config.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/.config/molecule/config.yml
diff --git a/examples/Taskfile.yml b/examples/Taskfile.yml
new file mode 100644
index 0000000..9b0913d
--- /dev/null
+++ b/examples/Taskfile.yml
@@ -0,0 +1,8 @@
+---
+# Sample taskfile, for testing linter ability to identify it
+version: "3"
+output: group
+vars:
+ HOSTNAME: # <-- this is valid for Taskfiles but not for ansible files
+ sh: echo ${HOSTNAME:-localhost}
+tasks: {}
diff --git a/examples/ansible-navigator.yml b/examples/ansible-navigator.yml
new file mode 100644
index 0000000..56e89cb
--- /dev/null
+++ b/examples/ansible-navigator.yml
@@ -0,0 +1,3 @@
+---
+# see https://ansible-navigator.readthedocs.io/en/latest/settings/
+ansible-navigator: {}
diff --git a/examples/broken/.ansible-lint b/examples/broken/.ansible-lint
new file mode 100644
index 0000000..6428f2c
--- /dev/null
+++ b/examples/broken/.ansible-lint
@@ -0,0 +1,2 @@
+# invalid ansible-lint config file
+foo: bar # invalid based on schema
diff --git a/examples/broken/ansible-navigator.yml b/examples/broken/ansible-navigator.yml
new file mode 100644
index 0000000..cb4f4f6
--- /dev/null
+++ b/examples/broken/ansible-navigator.yml
@@ -0,0 +1,3 @@
+---
+# https://ansible-navigator.readthedocs.io/en/latest/settings/
+ansible: {} # invalid as it is missing 'ansible-navigator' parent key
diff --git a/examples/broken/encoding.j2 b/examples/broken/encoding.j2
new file mode 100644
index 0000000..2616fcc
--- /dev/null
+++ b/examples/broken/encoding.j2
@@ -0,0 +1 @@
+À-Á
diff --git a/examples/broken/encoding.yml b/examples/broken/encoding.yml
new file mode 100644
index 0000000..2c6c2ab
--- /dev/null
+++ b/examples/broken/encoding.yml
Binary files differ
diff --git a/examples/broken/yaml-with-tabs/invalid-due-tabs.yaml b/examples/broken/yaml-with-tabs/invalid-due-tabs.yaml
new file mode 100644
index 0000000..0667f2e
--- /dev/null
+++ b/examples/broken/yaml-with-tabs/invalid-due-tabs.yaml
@@ -0,0 +1,4 @@
+{
+ "data": "this is not a valid YAML file as specification forbids tabs",
+ }
+}
diff --git a/examples/broken_collection_meta_runtime/meta/runtime.yml b/examples/broken_collection_meta_runtime/meta/runtime.yml
new file mode 100644
index 0000000..41f4ead
--- /dev/null
+++ b/examples/broken_collection_meta_runtime/meta/runtime.yml
@@ -0,0 +1,2 @@
+---
+foo: bar # should fail meta-runtime schema validation
diff --git a/examples/changelogs/changelog.yaml b/examples/changelogs/changelog.yaml
new file mode 100644
index 0000000..23809fe
--- /dev/null
+++ b/examples/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+foo: bar
diff --git a/examples/collection/CHANGELOG.rst b/examples/collection/CHANGELOG.rst
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/collection/CHANGELOG.rst
diff --git a/examples/collection/galaxy.yml b/examples/collection/galaxy.yml
new file mode 100644
index 0000000..d21efb2
--- /dev/null
+++ b/examples/collection/galaxy.yml
@@ -0,0 +1,17 @@
+---
+name: foo
+namespace: bar
+version: 0.0.0 # noqa: galaxy[version-incorrect]
+authors:
+ - John
+readme: ../README.md
+description: "..."
+dependencies:
+ other_namespace.collection1: ">=1.0.0"
+ other_namespace.collection2: ">=2.0.0,<3.0.0"
+ anderson55.my_collection: "*" # note: "*" selects the highest version available
+license:
+ - GPL # <-- invalid license value based on galaxy schema, a value like GPL-3.0-or-later would work
+ - Apache-2.0
+repository: some-url
+tags: [networking, test_tag]
diff --git a/examples/collection/meta/runtime.yml b/examples/collection/meta/runtime.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/collection/meta/runtime.yml
diff --git a/examples/collection/plugins/modules/alpha.py b/examples/collection/plugins/modules/alpha.py
new file mode 100644
index 0000000..c806cad
--- /dev/null
+++ b/examples/collection/plugins/modules/alpha.py
@@ -0,0 +1,44 @@
+"""An ansible test module."""
+
+
+DOCUMENTATION = """
+module: mod_1
+author:
+- test
+short_description: This is a test module
+description:
+- This is a test module
+version_added: 1.0.0
+options:
+ foo:
+ description:
+ - Dummy option I(foo)
+ type: str
+ bar:
+ description:
+ - Dummy option I(bar)
+ default: candidate
+ type: str
+ choices:
+ - candidate
+ - running
+ aliases:
+ - bam
+notes:
+- This is a dummy module
+"""
+
+EXAMPLES = """
+- name: test task-1
+ company_name.coll_1.mod_1:
+ foo: some value
+ bar: candidate
+"""
+
+RETURN = """
+baz:
+ description: test return 1
+ returned: success
+ type: list
+ sample: ['a','b']
+"""
diff --git a/examples/collection/plugins/modules/deep/beta.py b/examples/collection/plugins/modules/deep/beta.py
new file mode 100644
index 0000000..ffd9ff8
--- /dev/null
+++ b/examples/collection/plugins/modules/deep/beta.py
@@ -0,0 +1,44 @@
+"""An ansible test module."""
+
+
+DOCUMENTATION = """
+module: mod_2
+author:
+- test
+short_description: This is a test module
+description:
+- This is a test module
+version_added: 1.0.0
+options:
+ foo:
+ description:
+ - Dummy option I(foo)
+ type: str
+ bar:
+ description:
+ - Dummy option I(bar)
+ default: candidate
+ type: str
+ choices:
+ - candidate
+ - running
+ aliases:
+ - bam
+notes:
+- This is a dummy module
+"""
+
+EXAMPLES = """
+- name: test task-1
+ company_name.coll_1.mod_2:
+ foo: some value
+ bar: candidate
+"""
+
+RETURN = """
+baz:
+ description: test return 1
+ returned: success
+ type: list
+ sample: ['a','b']
+"""
diff --git a/examples/ee_broken/execution-environment.yml b/examples/ee_broken/execution-environment.yml
new file mode 100644
index 0000000..6b15f66
--- /dev/null
+++ b/examples/ee_broken/execution-environment.yml
@@ -0,0 +1,3 @@
+---
+# This should fail Execution Environment Schema validation
+foo: bar
diff --git a/examples/execution-environment.yml b/examples/execution-environment.yml
new file mode 100644
index 0000000..9bed441
--- /dev/null
+++ b/examples/execution-environment.yml
@@ -0,0 +1,4 @@
+---
+version: 1
+dependencies:
+ galaxy: requirements.yml
diff --git a/examples/galaxy_no_required_tags/fail/changelogs/changelog.yaml b/examples/galaxy_no_required_tags/fail/changelogs/changelog.yaml
new file mode 100644
index 0000000..52e7f38
--- /dev/null
+++ b/examples/galaxy_no_required_tags/fail/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+releases: {}
diff --git a/examples/galaxy_no_required_tags/fail/galaxy.yml b/examples/galaxy_no_required_tags/fail/galaxy.yml
new file mode 100644
index 0000000..48ee587
--- /dev/null
+++ b/examples/galaxy_no_required_tags/fail/galaxy.yml
@@ -0,0 +1,11 @@
+---
+namespace: bar
+name: foo
+version: 1.0.0 # <-- that version is not valid, should be 1.0.0 or greater
+authors:
+ - John
+readme: ../README.md
+description: "..."
+license:
+ - Apache-2.0
+repository: https://github.com/ansible-collections/community.REPO_NAME
diff --git a/examples/galaxy_no_required_tags/fail/meta/runtime.yml b/examples/galaxy_no_required_tags/fail/meta/runtime.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/galaxy_no_required_tags/fail/meta/runtime.yml
diff --git a/examples/galaxy_no_required_tags/pass/changelogs/changelog.yaml b/examples/galaxy_no_required_tags/pass/changelogs/changelog.yaml
new file mode 100644
index 0000000..52e7f38
--- /dev/null
+++ b/examples/galaxy_no_required_tags/pass/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+releases: {}
diff --git a/examples/galaxy_no_required_tags/pass/galaxy.yml b/examples/galaxy_no_required_tags/pass/galaxy.yml
new file mode 100644
index 0000000..0f62481
--- /dev/null
+++ b/examples/galaxy_no_required_tags/pass/galaxy.yml
@@ -0,0 +1,12 @@
+---
+namespace: bar
+name: foo
+version: 1.0.0 # <-- that version is not valid, should be 1.0.0 or greater
+authors:
+ - John
+readme: ../README.md
+description: "..."
+license:
+ - Apache-2.0
+repository: https://github.com/ansible-collections/community.REPO_NAME
+tags: [networking, test_tag]
diff --git a/examples/galaxy_no_required_tags/pass/meta/runtime.yml b/examples/galaxy_no_required_tags/pass/meta/runtime.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/galaxy_no_required_tags/pass/meta/runtime.yml
diff --git a/examples/group_vars/all.yml b/examples/group_vars/all.yml
new file mode 100644
index 0000000..ef692db
--- /dev/null
+++ b/examples/group_vars/all.yml
@@ -0,0 +1,2 @@
+---
+some_var: some_value_defined_in_group_vars_all
diff --git a/examples/host_vars/localhost.yml b/examples/host_vars/localhost.yml
new file mode 100644
index 0000000..9c058f5
--- /dev/null
+++ b/examples/host_vars/localhost.yml
@@ -0,0 +1,2 @@
+---
+some_var: some_value_defined_in_host_vars_localhost
diff --git a/examples/inventory/broken_dev_inventory.yml b/examples/inventory/broken_dev_inventory.yml
new file mode 100644
index 0000000..0d7a793
--- /dev/null
+++ b/examples/inventory/broken_dev_inventory.yml
@@ -0,0 +1,3 @@
+---
+all:
+ foo: {} # invalid based on inventory json schema
diff --git a/examples/inventory/inventory.yml b/examples/inventory/inventory.yml
new file mode 100644
index 0000000..8752d9b
--- /dev/null
+++ b/examples/inventory/inventory.yml
@@ -0,0 +1,31 @@
+---
+# https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html
+ungrouped: {}
+all:
+ hosts:
+ mail.example.com:
+ children:
+ webservers:
+ hosts:
+ foo.example.com:
+ bar.example.com:
+ dbservers:
+ hosts:
+ one.example.com:
+ two.example.com:
+ three.example.com:
+ east:
+ hosts:
+ foo.example.com:
+ one.example.com:
+ two.example.com:
+ west:
+ hosts:
+ bar.example.com:
+ three.example.com:
+ prod:
+ children:
+ east: {}
+ test:
+ children:
+ west: {}
diff --git a/examples/inventory/production.yml b/examples/inventory/production.yml
new file mode 100644
index 0000000..a8a7deb
--- /dev/null
+++ b/examples/inventory/production.yml
@@ -0,0 +1,38 @@
+---
+all:
+ hosts:
+ mail.example.com:
+ children:
+ webservers:
+ hosts:
+ foo.example.com:
+ bar.example.com:
+ # ranges are supported:
+ www[01:50].example.com:
+ www[01:50:2].example.com:
+ # these are variables:
+ var_1: value_1
+ another_var: 200
+ dbservers:
+ hosts:
+ one.example.com:
+ two.example.com:
+ three.example.com:
+ east:
+ hosts:
+ foo.example.com:
+ one.example.com:
+ two.example.com:
+ west:
+ hosts:
+ bar.example.com:
+ three.example.com:
+ prod:
+ children:
+ east:
+ test:
+ children:
+ west:
+ # add variables for all hosts
+ vars:
+ my_var: 123
diff --git a/examples/lineno.yml b/examples/lineno.yml
new file mode 100644
index 0000000..a741d91
--- /dev/null
+++ b/examples/lineno.yml
@@ -0,0 +1,3 @@
+---
+- tasks:
+ - git: repo=hello
diff --git a/examples/meta/changelogs/changelog.yaml b/examples/meta/changelogs/changelog.yaml
new file mode 100644
index 0000000..52e7f38
--- /dev/null
+++ b/examples/meta/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+releases: {}
diff --git a/examples/meta/galaxy.yml b/examples/meta/galaxy.yml
new file mode 100644
index 0000000..b981f5c
--- /dev/null
+++ b/examples/meta/galaxy.yml
@@ -0,0 +1,15 @@
+---
+name: foo
+namespace: bar
+version: 0.2.3 # <-- that version is not valid, should be 1.0.0 or greater
+authors:
+ - John
+readme: ../README.md
+description: "..."
+dependencies:
+ other_namespace.collection1: ">=1.0.0"
+ other_namespace.collection2: ">=2.0.0,<3.0.0"
+ anderson55.my_collection: "*" # note: "*" selects the highest version available
+license:
+ - Apache-2.0
+tags: [networking, test_tag]
diff --git a/examples/meta/meta/runtime.yml b/examples/meta/meta/runtime.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/meta/meta/runtime.yml
diff --git a/examples/meta/runtime.yml b/examples/meta/runtime.yml
new file mode 100644
index 0000000..895980b
--- /dev/null
+++ b/examples/meta/runtime.yml
@@ -0,0 +1,3 @@
+---
+# https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_structure.html
+requires_ansible: ">=2.10,<2.20"
diff --git a/examples/meta_runtime_version_checks/fail_0/meta/runtime.yml b/examples/meta_runtime_version_checks/fail_0/meta/runtime.yml
new file mode 100644
index 0000000..5ff8a8c
--- /dev/null
+++ b/examples/meta_runtime_version_checks/fail_0/meta/runtime.yml
@@ -0,0 +1,2 @@
+---
+requires_ansible: ">=2.20.0"
diff --git a/examples/meta_runtime_version_checks/fail_1/meta/runtime.yml b/examples/meta_runtime_version_checks/fail_1/meta/runtime.yml
new file mode 100644
index 0000000..eb5ade0
--- /dev/null
+++ b/examples/meta_runtime_version_checks/fail_1/meta/runtime.yml
@@ -0,0 +1,2 @@
+---
+requires_ansible: ">=2.9.0,<2.20"
diff --git a/examples/meta_runtime_version_checks/fail_2/meta/runtime.yml b/examples/meta_runtime_version_checks/fail_2/meta/runtime.yml
new file mode 100644
index 0000000..92db835
--- /dev/null
+++ b/examples/meta_runtime_version_checks/fail_2/meta/runtime.yml
@@ -0,0 +1,2 @@
+---
+requires_ansible: "2.13.0,<2.15"
diff --git a/examples/meta_runtime_version_checks/pass/meta/runtime.yml b/examples/meta_runtime_version_checks/pass/meta/runtime.yml
new file mode 100644
index 0000000..2b69758
--- /dev/null
+++ b/examples/meta_runtime_version_checks/pass/meta/runtime.yml
@@ -0,0 +1,2 @@
+---
+requires_ansible: ">=2.13.0,<2.15"
diff --git a/examples/no_changelog/galaxy.yml b/examples/no_changelog/galaxy.yml
new file mode 100644
index 0000000..2c35693
--- /dev/null
+++ b/examples/no_changelog/galaxy.yml
@@ -0,0 +1,17 @@
+---
+name: foo
+namespace: bar
+version: 0.0.0 # noqa: galaxy[version-incorrect]
+authors:
+ - John
+readme: ../README.md
+description: "..."
+dependencies:
+ other_namespace.collection1: ">=1.0.0"
+ other_namespace.collection2: ">=2.0.0,<3.0.0"
+ anderson55.my_collection: "*" # note: "*" selects the highest version available
+license:
+ - GPL-3.0-or-later
+ - Apache-2.0
+repository: some-url
+tags: [networking, test_tag]
diff --git a/examples/no_changelog/meta/runtime.yml b/examples/no_changelog/meta/runtime.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/no_changelog/meta/runtime.yml
diff --git a/examples/no_collection_version/changelogs/changelog.yaml b/examples/no_collection_version/changelogs/changelog.yaml
new file mode 100644
index 0000000..52e7f38
--- /dev/null
+++ b/examples/no_collection_version/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+releases: {}
diff --git a/examples/no_collection_version/galaxy.yml b/examples/no_collection_version/galaxy.yml
new file mode 100644
index 0000000..95d9d18
--- /dev/null
+++ b/examples/no_collection_version/galaxy.yml
@@ -0,0 +1,14 @@
+---
+name: galaxy_no_version
+namespace: test
+readme: ../README.md
+authors:
+ - John
+description: your collection description
+license:
+ - GPL
+ - Apache
+
+dependencies: {}
+repository: http://example.com/repository
+tags: [networking, test_tag]
diff --git a/examples/other/guess-1.yml b/examples/other/guess-1.yml
new file mode 100644
index 0000000..b11fb9c
--- /dev/null
+++ b/examples/other/guess-1.yml
@@ -0,0 +1,3 @@
+---
+- name: Minimal yaml to determine it as a playbook
+ hosts: localhost
diff --git a/examples/other/some.j2.yaml b/examples/other/some.j2.yaml
new file mode 100644
index 0000000..5d34f55
--- /dev/null
+++ b/examples/other/some.j2.yaml
@@ -0,0 +1,2 @@
+# Used to validate that a templated YAML file does not confuse the linter
+{% include 'port.j2' %}
diff --git a/examples/other/some.yaml-too b/examples/other/some.yaml-too
new file mode 100644
index 0000000..50a2ada
--- /dev/null
+++ b/examples/other/some.yaml-too
@@ -0,0 +1 @@
+# Used to test custom kinds defined in .ansible-config
diff --git a/examples/playbooks/.ansible-lint-only-builtins-allow b/examples/playbooks/.ansible-lint-only-builtins-allow
new file mode 100644
index 0000000..ddcbe6c
--- /dev/null
+++ b/examples/playbooks/.ansible-lint-only-builtins-allow
@@ -0,0 +1,13 @@
+# yaml-language-server: $schema=https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json
+# Mock modules or roles in order to pass ansible-playbook --syntax-check
+mock_modules:
+ - fake_namespace.fake_collection.fake_module
+
+only_builtins_allow_collections:
+ - fake_namespace.fake_collection
+only_builtins_allow_modules:
+ - zuul_return
+
+# skip rule to test builtin rule
+skip_list:
+ - args[module]
diff --git a/examples/playbooks/README.md b/examples/playbooks/README.md
new file mode 100644
index 0000000..48965c2
--- /dev/null
+++ b/examples/playbooks/README.md
@@ -0,0 +1,2 @@
+The `./roles` symlink helps Ansible find local roles used by files from
+current directory.
diff --git a/examples/playbooks/always-run-success.yml b/examples/playbooks/always-run-success.yml
new file mode 100644
index 0000000..43d1fea
--- /dev/null
+++ b/examples/playbooks/always-run-success.yml
@@ -0,0 +1,2 @@
+---
+- hosts: localhost
diff --git a/examples/playbooks/become.transformed.yml b/examples/playbooks/become.transformed.yml
new file mode 100644
index 0000000..ce53f56
--- /dev/null
+++ b/examples/playbooks/become.transformed.yml
@@ -0,0 +1,15 @@
+---
+- name: Fixture
+ hosts: all
+ tasks:
+ - name: Clone content repository
+ ansible.builtin.git:
+ repo: "{{ archive_services_repo_url }}"
+ dest: /home/www
+ accept_hostkey: true
+ version: master
+ update: false
+ become: true
+ become_user: nobody
+ notify:
+ - restart apache2
diff --git a/examples/playbooks/become.yml b/examples/playbooks/become.yml
new file mode 100644
index 0000000..ce53f56
--- /dev/null
+++ b/examples/playbooks/become.yml
@@ -0,0 +1,15 @@
+---
+- name: Fixture
+ hosts: all
+ tasks:
+ - name: Clone content repository
+ ansible.builtin.git:
+ repo: "{{ archive_services_repo_url }}"
+ dest: /home/www
+ accept_hostkey: true
+ version: master
+ update: false
+ become: true
+ become_user: nobody
+ notify:
+ - restart apache2
diff --git a/examples/playbooks/block.yml b/examples/playbooks/block.yml
new file mode 100644
index 0000000..6194cc6
--- /dev/null
+++ b/examples/playbooks/block.yml
@@ -0,0 +1,26 @@
+---
+- hosts: all
+
+ pre_tasks:
+ - { import_tasks: does-not-exist.yml }
+
+ tasks:
+ - block:
+ - name: Successful debug message
+ debug: msg='i execute normally'
+ - name: Failure command
+ ansible.builtin.command: /bin/false
+ changed_when: false
+ - name: Never reached debug message
+ debug: msg='i never execute, cause ERROR!'
+ rescue:
+ - name: Exception debug message
+ ansible.builtin.debug: msg='I caught an error'
+ - name: Another failure command
+ ansible.builtin.command: /bin/false
+ changed_when: false
+ - name: Another missed debug message
+ debug: msg='I also never execute :-('
+ always:
+ - name: Always reached debug message
+ ansible.builtin.debug: msg="this always executes"
diff --git a/examples/playbooks/blockincludes.yml b/examples/playbooks/blockincludes.yml
new file mode 100644
index 0000000..b8387a8
--- /dev/null
+++ b/examples/playbooks/blockincludes.yml
@@ -0,0 +1,21 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ varset: varset
+ tasks:
+ - name: Block level 1
+ block:
+ - name: Include under block level 1 # noqa: fqcn
+ include_tasks: tasks/nestedincludes.yml
+ - name: Block level 2
+ block:
+ # - include_tasks: "{{ varnotset }}.yml"
+ - name: Block level 3
+ block:
+ - name: Include under block level 3 # noqa: deprecated-module
+ ansible.builtin.include: "{{ varset }}.yml"
+ - name: Block level 4
+ block:
+ - name: INCLUDE under block level 4
+ ansible.builtin.include_tasks: tasks/directory with spaces/main.yml
diff --git a/examples/playbooks/blockincludes2.yml b/examples/playbooks/blockincludes2.yml
new file mode 100644
index 0000000..f11667b
--- /dev/null
+++ b/examples/playbooks/blockincludes2.yml
@@ -0,0 +1,18 @@
+---
+- name: Fixture
+ hosts: webservers
+ vars:
+ varset: varset
+ tasks:
+ - name: I am a block
+ block:
+ - name: Include under block
+ ansible.builtin.include_tasks: tasks/nestedincludes.yml
+ # - block:
+ # - include_tasks: "{{ varnotset }}.yml"
+ rescue:
+ - name: Include under rescue
+ ansible.builtin.include_tasks: "{{ varset }}.yml"
+ always:
+ - name: Include under always
+ ansible.builtin.include_tasks: tasks/directory with spaces/main.yml
diff --git a/examples/playbooks/bracketsmatchtest.yml b/examples/playbooks/bracketsmatchtest.yml
new file mode 100644
index 0000000..3b335ff
--- /dev/null
+++ b/examples/playbooks/bracketsmatchtest.yml
@@ -0,0 +1,4 @@
+---
+val1: "{{dest}}"
+val2: worry
+val3: "{{victory}}"
diff --git a/examples/playbooks/bug-core-warning-unique-filter-fallback.yml b/examples/playbooks/bug-core-warning-unique-filter-fallback.yml
new file mode 100644
index 0000000..5639668
--- /dev/null
+++ b/examples/playbooks/bug-core-warning-unique-filter-fallback.yml
@@ -0,0 +1,11 @@
+---
+- name: Fixture for test_bug_3216
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Set fact
+ ansible.builtin.set_fact:
+ qq: ["qq", "ww"]
+ - name: Print it
+ ansible.builtin.debug:
+ msg: "{{ qq | unique }}"
diff --git a/examples/playbooks/capture-warning.yml b/examples/playbooks/capture-warning.yml
new file mode 100644
index 0000000..ee20690
--- /dev/null
+++ b/examples/playbooks/capture-warning.yml
@@ -0,0 +1,8 @@
+---
+- name: Fixture to generate a warning
+ hosts: localhost
+ tasks:
+ - name: Generate a warning
+ ansible.builtin.debug:
+ msg: "This is a warning"
+ when: "{{ false }}" # noqa: 102 jinja[spacing]
diff --git a/examples/playbooks/collections/.gitignore b/examples/playbooks/collections/.gitignore
new file mode 100644
index 0000000..3cd6e1c
--- /dev/null
+++ b/examples/playbooks/collections/.gitignore
@@ -0,0 +1,2 @@
+ansible_collections
+requirements.yml
diff --git a/examples/playbooks/command-check-failure.yml b/examples/playbooks/command-check-failure.yml
new file mode 100644
index 0000000..f249ddd
--- /dev/null
+++ b/examples/playbooks/command-check-failure.yml
@@ -0,0 +1,13 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Command without checks
+ ansible.builtin.command: echo blah
+ args:
+ chdir: X
+
+ - name: Shell without checks
+ ansible.builtin.shell: echo blah
+ args:
+ chdir: X
+ become_method: xx
diff --git a/examples/playbooks/command-check-success.yml b/examples/playbooks/command-check-success.yml
new file mode 100644
index 0000000..2a8e43d
--- /dev/null
+++ b/examples/playbooks/command-check-success.yml
@@ -0,0 +1,63 @@
+---
+- name: Fixture for no-changed-when
+ hosts: localhost
+ tasks:
+ - name: Command with creates check
+ ansible.builtin.command: echo blah
+ args:
+ creates: Z
+
+ - name: Command with removes check
+ ansible.builtin.command: echo blah
+ args:
+ removes: Z
+
+ - name: Command with changed_when
+ ansible.builtin.command: echo blah
+ changed_when: false
+
+ - name: Command with inline creates # noqa: no-free-form
+ ansible.builtin.command: creates=Z echo blah
+
+ - name: Command with inline removes # noqa: no-free-form
+ ansible.builtin.command: removes=Z echo blah
+
+ - name: Command with cmd # noqa: fqcn[action-core]
+ command:
+ cmd: echo blah
+ args:
+ creates: Z
+
+ - name: Use shell with creates check # noqa: fqcn[action-core] command-instead-of-shell
+ shell: echo blah
+ args:
+ creates: Z
+
+ - name: Use shell with removes check # noqa: fqcn[action-core] command-instead-of-shell
+ shell: echo blah
+ args:
+ removes: Z
+
+ - name: Use shell with changed_when # noqa: fqcn[action-core] command-instead-of-shell
+ shell: echo blah
+ changed_when: false
+
+ - name: Use shell with inline creates # noqa: fqcn[action-core] no-free-form command-instead-of-shell
+ shell: creates=Z echo blah
+
+ - name: Use shell with inline removes # noqa: fqcn[action-core] no-free-form command-instead-of-shell
+ shell: removes=Z echo blah
+
+ - name: Use shell with cmd # noqa: fqcn[action-core] command-instead-of-shell
+ shell:
+ cmd: echo blah
+ args:
+ creates: Z
+
+- name: Fixture
+ hosts: localhost
+ handlers:
+ - name: Restart something # noqa: fqcn[action-core] no-changed-when
+ command: do something
+ - name: Foo # noqa: fqcn[action-core] deprecated-module
+ include: handlers/included-handlers.yml
diff --git a/examples/playbooks/common-include-1.yml b/examples/playbooks/common-include-1.yml
new file mode 100644
index 0000000..3a4691f
--- /dev/null
+++ b/examples/playbooks/common-include-1.yml
@@ -0,0 +1,10 @@
+---
+- name: Fixture for test_files_not_scanned_twice
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Some include
+ ansible.builtin.import_tasks: tasks/included-with-lint.yml
+ - name: Some include_tasks with file and jinja2
+ ansible.builtin.include_tasks:
+ file: "{{ 'tasks/included-with-lint.yml' }}"
diff --git a/examples/playbooks/common-include-2.yml b/examples/playbooks/common-include-2.yml
new file mode 100644
index 0000000..b3a942b
--- /dev/null
+++ b/examples/playbooks/common-include-2.yml
@@ -0,0 +1,7 @@
+---
+- name: Fixture
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Some include
+ ansible.builtin.include_tasks: tasks/included-with-lint.yml
diff --git a/examples/playbooks/conflicting_action.yml b/examples/playbooks/conflicting_action.yml
new file mode 100644
index 0000000..5355323
--- /dev/null
+++ b/examples/playbooks/conflicting_action.yml
@@ -0,0 +1,12 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Foo
+ ansible.builtin.debug:
+ msg: bar
+ ansible.builtin.command: echo
+# On this file ansible-playbook --syntax-check reports:
+# ERROR! conflicting action statements: debug, command
+#
+# The error appears to be in 'test/conflicting_action.yml': line 3, column 7, but may
+# be elsewhere in the file depending on the exact syntax problem.
diff --git a/examples/playbooks/contains_secrets.transformed.yml b/examples/playbooks/contains_secrets.transformed.yml
new file mode 100644
index 0000000..cf5388c
--- /dev/null
+++ b/examples/playbooks/contains_secrets.transformed.yml
@@ -0,0 +1,18 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ plain: hello123
+ # spell-checker: disable-next-line
+ # just 'hello123' encrypted with 'letmein' for test purposes
+ secret: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 63346434613163653866303630313238626164313961613935373137323639636333393338386232
+ 3735313061316666343839343665383036623237353263310a623639336530383433343833653138
+ 30393032393534316164613834393864616566646164363830316664623636643731383164376163
+ 3736653037356435310a303533383533353739323834343637366438633766666163656330343631
+ 3066
+ tasks:
+ - name: Just a debug task
+ ansible.builtin.debug:
+ msg: hello world
diff --git a/examples/playbooks/contains_secrets.yml b/examples/playbooks/contains_secrets.yml
new file mode 100644
index 0000000..cf5388c
--- /dev/null
+++ b/examples/playbooks/contains_secrets.yml
@@ -0,0 +1,18 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ plain: hello123
+ # spell-checker: disable-next-line
+ # just 'hello123' encrypted with 'letmein' for test purposes
+ secret: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 63346434613163653866303630313238626164313961613935373137323639636333393338386232
+ 3735313061316666343839343665383036623237353263310a623639336530383433343833653138
+ 30393032393534316164613834393864616566646164363830316664623636643731383164376163
+ 3736653037356435310a303533383533353739323834343637366438633766666163656330343631
+ 3066
+ tasks:
+ - name: Just a debug task
+ ansible.builtin.debug:
+ msg: hello world
diff --git a/examples/playbooks/custom_module.yml b/examples/playbooks/custom_module.yml
new file mode 100644
index 0000000..05c4a87
--- /dev/null
+++ b/examples/playbooks/custom_module.yml
@@ -0,0 +1,9 @@
+---
+- name: Fixture
+ hosts: localhost
+ gather_facts: false
+ tags:
+ - "{{ foo }}"
+ tasks:
+ - name: Run custom module # noqa: fqcn[action]
+ fake_module: {}
diff --git a/examples/playbooks/deep/empty.yml b/examples/playbooks/deep/empty.yml
new file mode 100644
index 0000000..722df73
--- /dev/null
+++ b/examples/playbooks/deep/empty.yml
@@ -0,0 +1,4 @@
+---
+- name: some playbook with incorrect name # <- should raise name[casing]
+ hosts: localhost
+ tasks: []
diff --git a/examples/playbooks/ematcher-rule.yml b/examples/playbooks/ematcher-rule.yml
new file mode 100644
index 0000000..7d64127
--- /dev/null
+++ b/examples/playbooks/ematcher-rule.yml
@@ -0,0 +1,13 @@
+---
+- hosts: localhost
+ name: BANNED
+- hosts: localhost
+ name: Another BANNED line
+ tasks:
+ - name: Foo
+ debug:
+ msg: A 3rd BANNED line
+
+ - name: Bar
+ ansible.builtin.command: echo something
+ changed_when: false
diff --git a/examples/playbooks/empty_playbook.yml b/examples/playbooks/empty_playbook.yml
new file mode 100644
index 0000000..271de72
--- /dev/null
+++ b/examples/playbooks/empty_playbook.yml
@@ -0,0 +1,3 @@
+# an empty playbook which makes ansible-playbook --syntax-check report
+# ERROR! Empty playbook, nothing to do
+# with exit code 4
diff --git a/examples/playbooks/example.yml b/examples/playbooks/example.yml
new file mode 100644
index 0000000..fa1a635
--- /dev/null
+++ b/examples/playbooks/example.yml
@@ -0,0 +1,49 @@
+---
+- name: Fixture for test_example
+ hosts: webservers
+ vars:
+ old_school: 1.2.3
+ bracket: and close bracket
+
+ tasks:
+ - name: Unset variable
+ action: ansible.builtin.command echo {{this_variable}} is not set in this playbook
+
+ - name: Trailing whitespace
+ action: ansible.builtin.command echo do nothing
+
+ - name: Run git check
+ action: ansible.builtin.git a=b c=d
+
+ - name: Run git check 2
+ action: ansible.builtin.git version=HEAD c=d
+
+ - name: Run git check 3
+ ansible.builtin.git: version=a1b2c3d4 repo=xyz bobbins=d
+
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+
+ - name: Executing git through command
+ action: ansible.builtin.command chdir=bobbins creates=whatever /usr/bin/git clone blah
+
+ - name: Using git module
+ action: ansible.builtin.git repo=blah
+
+ - name: Passing git as an argument to another task
+ action: ansible.builtin.debug msg="{{item}}"
+ with_items:
+ - git # yamllint wrong indentation
+ - bobbins
+
+ - name: Yum latest
+ ansible.builtin.yum: state=latest name=httpd
+
+ - ansible.builtin.debug: msg="debug task without a name"
+
+ - name: Run apt latest
+ ansible.builtin.apt: state=latest name=apache2
+
+ - ansible.builtin.meta: flush_handlers
+ # empty task is currently accepted by ansible as valid code but not our schemas:
+ -
diff --git a/examples/playbooks/extra_vars.yml b/examples/playbooks/extra_vars.yml
new file mode 100644
index 0000000..3cb9f43
--- /dev/null
+++ b/examples/playbooks/extra_vars.yml
@@ -0,0 +1,10 @@
+---
+- name: Fixture for test_extra_vars_passed_to_command test
+ hosts: all
+ tags:
+ - baz
+ - "{{ foo }}"
+ tasks:
+ - name: Show `complex_variable` value loaded from `extra_vars`
+ ansible.builtin.debug:
+ msg: "{{ complex_variable }}"
diff --git a/examples/playbooks/find_children.yml b/examples/playbooks/find_children.yml
new file mode 100644
index 0000000..9e7a6df
--- /dev/null
+++ b/examples/playbooks/find_children.yml
@@ -0,0 +1,10 @@
+---
+# Bug reproducer https://github.com/ansible/ansible-lint/issues/2846
+- name: Play
+ hosts: localhost
+ gather_facts: false
+ connection: local
+ roles:
+ - role: acme.sample4
+ vars:
+ date_ko_1: "{{ lookup('pipe', 'date') }}"
diff --git a/examples/playbooks/fqcn.transformed.yml b/examples/playbooks/fqcn.transformed.yml
new file mode 100644
index 0000000..2b758bc
--- /dev/null
+++ b/examples/playbooks/fqcn.transformed.yml
@@ -0,0 +1,16 @@
+---
+- name: FQCN transform test file
+ hosts: localhost
+ tasks:
+ - name: Rewrite shell to ansible.builtin.shell via the fqcn[action-core] transform # noqa: command-instead-of-shell
+ ansible.builtin.shell: echo This rule should get matched by the fqcn[action-core] rule
+ changed_when: false
+ - name: Rewrite openssh_keypair to community.crypto.openssh_keypair via the fqcn[action] transform
+ community.crypto.openssh_keypair:
+ path: /tmp/supersecret
+ - name: Rewrite ansible.builtin.synchronize to ansible.posix.synchronize via the fqcn[canonical] transform
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy2
+ owner: false
+ group: false
diff --git a/examples/playbooks/fqcn.yml b/examples/playbooks/fqcn.yml
new file mode 100644
index 0000000..0e64a83
--- /dev/null
+++ b/examples/playbooks/fqcn.yml
@@ -0,0 +1,16 @@
+---
+- name: FQCN transform test file
+ hosts: localhost
+ tasks:
+ - name: Rewrite shell to ansible.builtin.shell via the fqcn[action-core] transform # noqa: command-instead-of-shell
+ shell: echo This rule should get matched by the fqcn[action-core] rule
+ changed_when: false
+ - name: Rewrite openssh_keypair to community.crypto.openssh_keypair via the fqcn[action] transform
+ openssh_keypair:
+ path: /tmp/supersecret
+ - name: Rewrite ansible.builtin.synchronize to ansible.posix.synchronize via the fqcn[canonical] transform
+ ansible.builtin.synchronize:
+ src: dummy
+ dest: dummy2
+ owner: false
+ group: false
diff --git a/examples/playbooks/handlers/included-handlers.yml b/examples/playbooks/handlers/included-handlers.yml
new file mode 100644
index 0000000..6dec22d
--- /dev/null
+++ b/examples/playbooks/handlers/included-handlers.yml
@@ -0,0 +1,6 @@
+---
+- name: Restart xyz # noqa: no-free-form fqcn[action-core]
+ service: name=xyz state=restarted
+# see Issue #165
+- name: Command handler issue 165 # noqa: fqcn[action-core] no-changed-when
+ command: do something
diff --git a/examples/playbooks/handlers/y.yml b/examples/playbooks/handlers/y.yml
new file mode 100644
index 0000000..cd984f8
--- /dev/null
+++ b/examples/playbooks/handlers/y.yml
@@ -0,0 +1,3 @@
+---
+- name: Funny handler
+ action: service name=funny state=started force=true
diff --git a/examples/playbooks/include-import-tasks-in-role.yml b/examples/playbooks/include-import-tasks-in-role.yml
new file mode 100644
index 0000000..26a658a
--- /dev/null
+++ b/examples/playbooks/include-import-tasks-in-role.yml
@@ -0,0 +1,5 @@
+---
+- name: Fixture
+ hosts: all
+ roles:
+ - role_with_task_inclusions
diff --git a/examples/playbooks/include-in-block.yml b/examples/playbooks/include-in-block.yml
new file mode 100644
index 0000000..9f3a8fe
--- /dev/null
+++ b/examples/playbooks/include-in-block.yml
@@ -0,0 +1,6 @@
+---
+- name: Fixture
+ hosts: all
+ tasks:
+ - name: Include
+ ansible.builtin.include_tasks: tasks/include-in-block-inner.yml
diff --git a/examples/playbooks/include.yml b/examples/playbooks/include.yml
new file mode 100644
index 0000000..5596728
--- /dev/null
+++ b/examples/playbooks/include.yml
@@ -0,0 +1,18 @@
+---
+- hosts: bobbins
+
+ pre_tasks:
+ - ansible.builtin.include_tasks: tasks/x.yml
+
+ roles:
+ - hello
+ - { role: more_complex, t: z }
+
+ tasks:
+ - ansible.builtin.include_tasks: tasks/x.yml
+ - ansible.builtin.include_tasks: tasks/x.yml y=z
+
+ handlers:
+ - ansible.builtin.include_tasks: handlers/y.yml
+
+- ansible.builtin.include_tasks: play.yml
diff --git a/examples/playbooks/jinja-spacing.yml b/examples/playbooks/jinja-spacing.yml
new file mode 100644
index 0000000..b6824c2
--- /dev/null
+++ b/examples/playbooks/jinja-spacing.yml
@@ -0,0 +1,89 @@
+---
+# Should raise jinja[spacing] at tasks line 23, 26, 29, 54, 65
+- name: Fixture for testing jinja2[spacing]
+ hosts: all
+ tasks:
+ - name: Good variable format
+ ansible.builtin.debug:
+ msg: "{{ good_format }}"
+ - name: Good variable format
+ ansible.builtin.debug:
+ msg: "Value: {{ good_format }}"
+ - name: Good variable filter format
+ ansible.builtin.debug:
+ msg: "{{ good_format | filter }}"
+ - name: Good variable filter format
+ ansible.builtin.debug:
+ msg: "Value: {{ good_format | filter }}"
+ - name: Jinja escaping allowed
+ ansible.builtin.debug:
+ msg: "{{ '{{' }}"
+ - name: Jinja escaping allowed
+ # noqa: risky-shell-pipe
+ ansible.builtin.shell: docker info --format '{{ '{{' }}json .Swarm.LocalNodeState{{ '}}' }}' | tr -d '"'
+ changed_when: false
+ - name: Jinja whitespace control allowed
+ ansible.builtin.debug:
+ msg: |
+ {{ good_format }}/
+ {{- good_format }}
+ {{- good_format -}}
+ - name: Bad variable format
+ ansible.builtin.debug:
+ msg: "{{bad_format}}" # <-- 1
+ - name: Bad variable format
+ ansible.builtin.debug:
+ msg: "Value: {{ bad_format}}" # <-- 2
+ - name: Bad variable format
+ ansible.builtin.debug:
+ msg: "{{bad_format }}" # <-- 3
+ - name: Bad variable filter format
+ ansible.builtin.debug:
+ msg: "{{ bad_format|filter }}" # <-- 4
+ - name: Bad variable filter format
+ ansible.builtin.debug:
+ msg: "Value: {{ bad_format |filter }}" # <-- 5
+ - name: Bad variable filter format
+ ansible.builtin.debug:
+ msg: "{{ bad_format| filter }}" # <-- 6
+ - name: Not a jinja variable # noqa: jinja[spacing]
+ ansible.builtin.debug:
+ # spell-checker: disable-next-line
+ msg: data = ${lookup{$local_part}lsearch{/etc/aliases}}
+ - name: JSON inside jinja is valid
+ ansible.builtin.debug:
+ msg: "{{ {'test': {'subtest': variable}} }}"
+ - name: Avoid false positive on multiline
+ vars:
+ cases:
+ case1: >-
+ http://foo.com/{{
+ case1 }}
+ case2: >-
+ http://bar.com/{{
+ case2 }}
+ ansible.builtin.debug:
+ var: cases
+
+ - name: Valid single line nested JSON false positive
+ ansible.builtin.debug:
+ msg: "{{ {'dummy_2': {'nested_dummy_1': 'value_1', 'nested_dummy_2': value_2}} | combine(dummy_1) }}"
+
+ - name: Invalid single line nested JSON
+ ansible.builtin.debug:
+ msg: "{{ {'dummy_2': {'nested_dummy_1': 'value_1', 'nested_dummy_2': value_2}} | combine(dummy_1)}}" # <-- 7
+
+ - name: Valid multiline nested JSON false positive
+ ansible.builtin.debug:
+ msg: >-
+ {{ {'dummy_2': {'nested_dummy_1': value_1,
+ 'nested_dummy_2': value_2}} |
+ combine(dummy_1) }}
+
+ - name: Invalid multiline nested JSON
+ ansible.builtin.debug:
+ # not an error currently because current implementation skips multiline expressions
+ msg: >-
+ {{ {'dummy_2': {'nested_dummy_1': value_1,
+ 'nested_dummy_2': value_2}} |
+ combine(dummy_1)}}
diff --git a/examples/playbooks/json-schema-fail.yml b/examples/playbooks/json-schema-fail.yml
new file mode 100644
index 0000000..5760632
--- /dev/null
+++ b/examples/playbooks/json-schema-fail.yml
@@ -0,0 +1,4 @@
+---
+- name: This should raise json-schema error, due to hosts missing the last letter
+ host: localhost
+ tasks: []
diff --git a/examples/playbooks/lots_of_warnings.transformed.yml b/examples/playbooks/lots_of_warnings.transformed.yml
new file mode 100644
index 0000000..1bca9da
--- /dev/null
+++ b/examples/playbooks/lots_of_warnings.transformed.yml
@@ -0,0 +1,1000 @@
+---
+# This playbook causes ansible-lint to output tons of warnings
+# Enough to exceed typical stdout buffering size and thus to show the need for
+# catching IOError (EPIPE) errors.
+
+- name: Fixture
+ hosts: webservers
+ tasks:
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
diff --git a/examples/playbooks/lots_of_warnings.yml b/examples/playbooks/lots_of_warnings.yml
new file mode 100644
index 0000000..1bca9da
--- /dev/null
+++ b/examples/playbooks/lots_of_warnings.yml
@@ -0,0 +1,1000 @@
+---
+# This playbook causes ansible-lint to output tons of warnings
+# Enough to exceed typical stdout buffering size and thus to show the need for
+# catching IOError (EPIPE) errors.
+
+- name: Fixture
+ hosts: webservers
+ tasks:
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
+ - name: Executing git through command
+ action: ansible.builtin.command git clone blah
diff --git a/examples/playbooks/mocked_dependency.yml b/examples/playbooks/mocked_dependency.yml
new file mode 100644
index 0000000..531e0c1
--- /dev/null
+++ b/examples/playbooks/mocked_dependency.yml
@@ -0,0 +1,10 @@
+---
+- hosts: localhost
+ roles:
+ - mocked_role
+ - fake_namespace.fake_collection.fake_role
+ tasks:
+ - name: Some task
+ zuul_return: {}
+ - name: Mocked module from collection
+ fake_namespace.fake_collection.fake_module: {}
diff --git a/examples/playbooks/multiline-brackets-do-not-match-test.yml b/examples/playbooks/multiline-brackets-do-not-match-test.yml
new file mode 100644
index 0000000..f13315e
--- /dev/null
+++ b/examples/playbooks/multiline-brackets-do-not-match-test.yml
@@ -0,0 +1,22 @@
+---
+- hosts: foo
+ roles:
+ - ../../../roles/base_os
+ - ../../../roles/repos
+ - {
+ role: ../../../roles/openshift_master,
+ oo_minion_ips: "{ hostvars['localhost'].oo_minion_ips | default(['']) }}",
+ oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}"
+ }
+ - ../../../roles/pods
+
+- name: Set Origin specific facts on localhost (for later use)
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Setting oo_minion_ips fact on localhost
+ ansible.builtin.set_fact:
+ oo_minion_ips: "{{ hostvars
+ | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-minion'])
+ | oo_collect(attribute='ansible_eth0.ipv4.address') }"
+ when: groups['tag_env-host-type-' + oo_env + '-openshift-minion'] is defined
diff --git a/examples/playbooks/multiline-bracketsmatchtest.yml b/examples/playbooks/multiline-bracketsmatchtest.yml
new file mode 100644
index 0000000..86a19f7
--- /dev/null
+++ b/examples/playbooks/multiline-bracketsmatchtest.yml
@@ -0,0 +1,22 @@
+---
+- hosts: foo
+ roles:
+ - ../../../roles/base_os
+ - ../../../roles/repos
+ - {
+ role: ../../../roles/openshift_master,
+ oo_minion_ips: "{{ hostvars['localhost'].oo_minion_ips | default(['']) }}",
+ oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}"
+ }
+ - ../../../roles/pods
+
+- name: Set Origin specific facts on localhost (for later use)
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Setting oo_minion_ips fact on localhost
+ ansible.builtin.set_fact:
+ oo_minion_ips: "{{ hostvars
+ | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-minion'])
+ | oo_collect(attribute='ansible_eth0.ipv4.address') }}"
+ when: groups['tag_env-host-type-' + oo_env + '-openshift-minion'] is defined
diff --git a/examples/playbooks/name-case.transformed.yml b/examples/playbooks/name-case.transformed.yml
new file mode 100644
index 0000000..03b8c46
--- /dev/null
+++ b/examples/playbooks/name-case.transformed.yml
@@ -0,0 +1,4 @@
+---
+- name: This lacks a capitalization
+ hosts: localhost
+ tasks: []
diff --git a/examples/playbooks/name-case.yml b/examples/playbooks/name-case.yml
new file mode 100644
index 0000000..5480d2c
--- /dev/null
+++ b/examples/playbooks/name-case.yml
@@ -0,0 +1,4 @@
+---
+- name: this lacks a capitalization
+ hosts: localhost
+ tasks: []
diff --git a/examples/playbooks/no_handler_fail.yml b/examples/playbooks/no_handler_fail.yml
new file mode 100644
index 0000000..28840ce
--- /dev/null
+++ b/examples/playbooks/no_handler_fail.yml
@@ -0,0 +1,27 @@
+---
+- name: Fixture for no-handler rule
+ hosts: all
+ tasks:
+ - name: This should trigger no-handler rule # noqa: no-changed-when
+ ansible.builtin.command: echo could be done better
+ when: result is changed
+
+ - name: Do anything # noqa: no-changed-when
+ ansible.builtin.command: echo 123
+ when:
+ - something.changed
+
+ - name: This should be a handler
+ ansible.builtin.debug:
+ msg: why isn't this a handler
+ when: result.changed
+
+ - name: This should be a handler 3 # noqa: literal-compare
+ ansible.builtin.debug:
+ msg: why isn't this a handler
+ when: result.changed == true
+
+ - name: This should be a handler 4 # noqa: literal-compare
+ ansible.builtin.debug:
+ msg: why isn't this a handler
+ when: result['changed'] == true
diff --git a/examples/playbooks/no_handler_pass.yml b/examples/playbooks/no_handler_pass.yml
new file mode 100644
index 0000000..5c44891
--- /dev/null
+++ b/examples/playbooks/no_handler_pass.yml
@@ -0,0 +1,84 @@
+---
+- name: Fixture for no-handler-pass
+ hosts: all
+ tasks:
+ - name: Execute something
+ ansible.builtin.command: echo 123
+ register: result
+ changed_when: true
+
+ - name: Print helpful error message
+ ansible.builtin.debug:
+ var: result
+ when: result.failed
+
+ - name: Do something when hello is output
+ ansible.builtin.debug:
+ msg: why isn't this a handler
+ when: result.stdout == "hello"
+
+ - name: Never actually debug
+ ansible.builtin.debug:
+ var: result
+ when: false
+
+ - name: "Don't execute this step"
+ ansible.builtin.debug:
+ msg: "debug message"
+ when:
+ - false
+
+ - name: Check when with a list
+ ansible.builtin.debug:
+ var: result
+ when:
+ - conditionA
+ - conditionB
+
+ - name: Check when with a list of size 1
+ ansible.builtin.debug:
+ var: result
+ when:
+ - conditionA
+
+ - name: Registering task 1
+ ansible.builtin.command: echo Hello
+ register: r1
+ changed_when: true
+
+ - name: Registering task 2
+ ansible.builtin.command: echo Hello
+ register: r2
+ changed_when: true
+
+ - name: Use when task # noqa: no-changed-when
+ ansible.builtin.command: echo Hello
+ when: r1.changed and r2.changed
+
+ - name: Use when with or # noqa: no-changed-when
+ ansible.builtin.command: echo Hello
+ when: r1.changed or conditionA
+
+ - name: Use when with list of conditions # noqa: no-changed-when
+ ansible.builtin.command: echo Hello
+ when:
+ - r1.changed
+ - conditionA
+
+ - name: Registering task
+ ansible.builtin.command: echo Hello
+ register: r
+ changed_when: true
+
+ - name: When task not changed # noqa: no-changed-when
+ ansible.builtin.command: echo Not changed
+ when: not r.changed
+
+ - name: Execute command # noqa: no-changed-when
+ ansible.builtin.command: echo hello
+ register: result
+
+ - name: This should be a handler 2
+ ansible.builtin.debug:
+ msg: why isn't this a handler
+ when: result | changed
diff --git a/examples/playbooks/no_relative_paths_fail.yml b/examples/playbooks/no_relative_paths_fail.yml
new file mode 100644
index 0000000..1f97c3c
--- /dev/null
+++ b/examples/playbooks/no_relative_paths_fail.yml
@@ -0,0 +1,23 @@
+---
+- name: Fixture for no-relative-paths
+ hosts: localhost
+ tasks:
+ - name: Template example # <-- 1st
+ ansible.builtin.template:
+ src: ../templates/foo.j2
+ dest: /etc/file.conf
+ mode: "0644"
+ - name: Copy example # <-- 2nd
+ ansible.builtin.copy:
+ src: ../files/foo.conf
+ dest: /etc/foo.conf
+ mode: "0644"
+ # Removed from test suite as module is no longer part of core
+ # - name: Some win_template example
+ # win_template:
+ # src: ../win_templates/file.conf.j2
+ # dest: file.conf
+ # - name: Some win_copy example
+ # win_copy:
+ # src: ../files/foo.conf
+ # dest: renamed-foo.conf
diff --git a/examples/playbooks/no_relative_paths_pass.yml b/examples/playbooks/no_relative_paths_pass.yml
new file mode 100644
index 0000000..7c5a98a
--- /dev/null
+++ b/examples/playbooks/no_relative_paths_pass.yml
@@ -0,0 +1,14 @@
+---
+- name: Fixture for no-relative-paths
+ hosts: localhost
+ tasks:
+ - name: Content example with no src
+ ansible.builtin.copy:
+ content: "# This file was moved to /etc/other.conf"
+ dest: /etc/mine.conf
+ mode: "0644"
+ - name: Copy example
+ ansible.builtin.copy:
+ src: /home/example/files/foo.conf
+ dest: /etc/foo.conf
+ mode: "0644"
diff --git a/examples/playbooks/nomatches.yml b/examples/playbooks/nomatches.yml
new file mode 100644
index 0000000..a3fac5d
--- /dev/null
+++ b/examples/playbooks/nomatches.yml
@@ -0,0 +1,9 @@
+---
+- hosts: whatever
+
+ tasks:
+ - name: Hello world
+ ansible.builtin.action: debug msg="Hello!"
+
+ - name: This should be fine too
+ ansible.builtin.action: file state=touch mode=0644 dest=./wherever
diff --git a/examples/playbooks/nomatchestest.transformed.yml b/examples/playbooks/nomatchestest.transformed.yml
new file mode 100644
index 0000000..4fba8ef
--- /dev/null
+++ b/examples/playbooks/nomatchestest.transformed.yml
@@ -0,0 +1,9 @@
+---
+- name: Fixture
+ hosts: whatever
+ tasks:
+ - name: Hello world
+ action: debug msg="Hello!" # noqa: fqcn[action-core]
+
+ - name: This should be fine too
+ action: file state=touch dest=./wherever mode=0600 # noqa: fqcn[action-core]
diff --git a/examples/playbooks/nomatchestest.yml b/examples/playbooks/nomatchestest.yml
new file mode 100644
index 0000000..4fba8ef
--- /dev/null
+++ b/examples/playbooks/nomatchestest.yml
@@ -0,0 +1,9 @@
+---
+- name: Fixture
+ hosts: whatever
+ tasks:
+ - name: Hello world
+ action: debug msg="Hello!" # noqa: fqcn[action-core]
+
+ - name: This should be fine too
+ action: file state=touch dest=./wherever mode=0600 # noqa: fqcn[action-core]
diff --git a/examples/playbooks/noqa-nested.yml b/examples/playbooks/noqa-nested.yml
new file mode 100644
index 0000000..0659d48
--- /dev/null
+++ b/examples/playbooks/noqa-nested.yml
@@ -0,0 +1,9 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Example of multi-level block
+ block:
+ - name: 2nd level
+ block:
+ - ansible.builtin.debug: # noqa: name[missing]
+ msg: "test unnamed task in block"
diff --git a/examples/playbooks/noqa.yml b/examples/playbooks/noqa.yml
new file mode 100644
index 0000000..a69c263
--- /dev/null
+++ b/examples/playbooks/noqa.yml
@@ -0,0 +1,6 @@
+---
+- hosts: localhost
+ tasks:
+ - name: This would typically fire latest[git] and partial-become
+ become_user: alice # noqa: latest[git] partial-become
+ git: src=/path/to/git/repo dest=checkout
diff --git a/examples/playbooks/norole.yml b/examples/playbooks/norole.yml
new file mode 100644
index 0000000..2ee7a83
--- /dev/null
+++ b/examples/playbooks/norole.yml
@@ -0,0 +1,5 @@
+---
+- hosts:
+ - localhost
+ roles:
+ - name: node
diff --git a/examples/playbooks/norole2.yml b/examples/playbooks/norole2.yml
new file mode 100644
index 0000000..2ee7a83
--- /dev/null
+++ b/examples/playbooks/norole2.yml
@@ -0,0 +1,5 @@
+---
+- hosts:
+ - localhost
+ roles:
+ - name: node
diff --git a/examples/playbooks/package-check-failure.yml b/examples/playbooks/package-check-failure.yml
new file mode 100644
index 0000000..393b52b
--- /dev/null
+++ b/examples/playbooks/package-check-failure.yml
@@ -0,0 +1,21 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Install ansible
+ ansible.builtin.yum: name=ansible state=latest
+
+ - name: Install ansible-lint
+ ansible.builtin.pip: name=ansible-lint
+ args:
+ state: latest
+
+ - name: Install some-package
+ ansible.builtin.package:
+ name: some-package
+ state: latest
+
+ - name: Install ansible with update_only to false
+ ansible.builtin.yum:
+ name: sudo
+ state: latest
+ update_only: false
diff --git a/examples/playbooks/package-check-success.yml b/examples/playbooks/package-check-success.yml
new file mode 100644
index 0000000..a513d5d
--- /dev/null
+++ b/examples/playbooks/package-check-success.yml
@@ -0,0 +1,22 @@
+---
+- hosts: localhost
+ tasks:
+ - name: Install ansible
+ ansible.builtin.yum: name=ansible-2.1.0.0 state=present
+
+ - name: Install ansible-lint
+ ansible.builtin.pip: name=ansible-lint
+ args:
+ state: present
+ version: 3.1.2
+
+ - name: Install some-package
+ ansible.builtin.package:
+ name: Some-package
+ state: present
+
+ - name: Update ansible
+ ansible.builtin.yum:
+ name: sudo
+ state: latest
+ update_only: true
diff --git a/examples/playbooks/pass-loop-var-prefix.yml b/examples/playbooks/pass-loop-var-prefix.yml
new file mode 100644
index 0000000..8f33399
--- /dev/null
+++ b/examples/playbooks/pass-loop-var-prefix.yml
@@ -0,0 +1,18 @@
+---
+- hosts: localhost
+ tasks:
+ # validate that we did not trigger loop-var-prefix on playbooks
+ - name: That should pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - foo
+ - bar
+ - name: A block
+ block:
+ - name: That should also pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - apples
+ - oranges
diff --git a/examples/playbooks/play-without-extension b/examples/playbooks/play-without-extension
new file mode 100644
index 0000000..e056ab5
--- /dev/null
+++ b/examples/playbooks/play-without-extension
@@ -0,0 +1,2 @@
+- name: A playbook without expected yml or yaml extension
+ hosts: localhost
diff --git a/examples/playbooks/play.yml b/examples/playbooks/play.yml
new file mode 100644
index 0000000..40f387f
--- /dev/null
+++ b/examples/playbooks/play.yml
@@ -0,0 +1,6 @@
+---
+- hosts: bobbins
+
+ tasks:
+ - name: A bad play
+ action: ansible.builtin.command service blah restart
diff --git a/examples/playbooks/play_miss_include.yml b/examples/playbooks/play_miss_include.yml
new file mode 100644
index 0000000..f402c41
--- /dev/null
+++ b/examples/playbooks/play_miss_include.yml
@@ -0,0 +1,5 @@
+---
+- name: Fixture
+ hosts: all
+ roles:
+ - include_miss
diff --git a/examples/playbooks/playbook-imported.yml b/examples/playbooks/playbook-imported.yml
new file mode 100644
index 0000000..fd4dd91
--- /dev/null
+++ b/examples/playbooks/playbook-imported.yml
@@ -0,0 +1,11 @@
+---
+- name: Fixture
+ hosts: localhost
+ connection: local
+ gather_facts: false
+ tasks:
+ - ansible.builtin.command:
+ cmd: echo "no name" # should generate name[missing]
+ - name: Another task
+ ansible.builtin.debug:
+ msg: debug message
diff --git a/examples/playbooks/playbook-parent.yml b/examples/playbooks/playbook-parent.yml
new file mode 100644
index 0000000..b7d0edd
--- /dev/null
+++ b/examples/playbooks/playbook-parent.yml
@@ -0,0 +1,9 @@
+---
+- name: Importing another playbook
+ ansible.builtin.import_playbook: playbook-imported.yml
+
+- name: Importing playbook from collection
+ import_playbook: community.molecule.validate # noqa: fqcn
+
+- name: Importing playbook using jinja2
+ import_playbook: "{{ 'community.molecule.validate' }}" # noqa: fqcn
diff --git a/examples/playbooks/roles b/examples/playbooks/roles
new file mode 120000
index 0000000..d8c4472
--- /dev/null
+++ b/examples/playbooks/roles
@@ -0,0 +1 @@
+../roles \ No newline at end of file
diff --git a/examples/playbooks/rule-args-module-fail.yml b/examples/playbooks/rule-args-module-fail.yml
new file mode 100644
index 0000000..25371fb
--- /dev/null
+++ b/examples/playbooks/rule-args-module-fail.yml
@@ -0,0 +1,37 @@
+---
+- name: Fixture to validate module options failure scenarios
+ hosts: localhost
+ tasks:
+ - name: Clone content repository
+ # module should produce: 'missing required arguments: repo'
+ ansible.builtin.git:
+ dest: /home/www
+ accept_hostkey: true
+ version: master
+ update: false
+
+ - name: Enable service httpd and ensure it is not masked
+ # module should produce: 'missing parameter(s) required by 'enabled': name'
+ ansible.builtin.systemd:
+ enabled: true
+ masked: false
+
+ - name: Enable service httpd and ensure it is not masked
+ # module should produce: 'Unsupported parameters for ansible.builtin.systemd module"
+ ansible.builtin.systemd:
+ foo: true
+
+ - name: An invalid call of setup module
+ # setup module in ansible is the only module that has a .. relative
+ # import that used to cause problems
+ ansible.builtin.setup:
+ foo: # this is a nested object which will have the __ injections
+ # that we later need to clean
+ bar: true
+
+ - name: Remove deployment dir
+ # module should produce: 'value of state must be one of: absent, directory, file, hard, link, touch, got: away'
+ ansible.builtin.file:
+ path: /opt/software/deployment
+ state: away
+ mode: "0600"
diff --git a/examples/playbooks/rule-args-module-pass.yml b/examples/playbooks/rule-args-module-pass.yml
new file mode 100644
index 0000000..995e4fe
--- /dev/null
+++ b/examples/playbooks/rule-args-module-pass.yml
@@ -0,0 +1,97 @@
+---
+- name: Fixture to validate module options pass scenario
+ hosts: localhost
+ tasks:
+ - name: Clone content repository
+ ansible.builtin.git:
+ repo: "{{ archive_services_repo_url }}"
+ dest: /home/www
+ accept_hostkey: true
+ version: master
+ update: false
+
+ - name: Enable service httpd and ensure it is not masked
+ ansible.builtin.systemd:
+ name: httpd
+ enabled: false
+ masked: false
+
+ - name: Clear deployment dir
+ ansible.builtin.file:
+ path: /opt/software/deployment
+ state: "{{ item }}"
+ mode: "0755"
+ with_items:
+ - absent
+ - directory
+
+ - name: Bug https://github.com/ansible/ansible-lint/issues/2962
+ become: true
+ ansible.builtin.apt_key:
+ url: "{{ zj_item['url'] | default(omit) }}"
+ data: "{{ zj_item['data'] | default(omit) }}"
+ loop: "{{ repositories_keys }}"
+ loop_control:
+ loop_var: zj_item
+
+ - name: Bug 2428 daemon_reload should be allowed
+ ansible.builtin.systemd:
+ name: foo
+ state: restarted
+ daemon_reload: true
+
+ - name: Bug 2424 async_status
+ ansible.builtin.async_status:
+ jid: "{{ 999 }}"
+
+ - name: Bug https://github.com/VSChina/vscode-ansible/issues/261
+ ansible.builtin.set_fact:
+ dns_nameservers: "{{ var1 }}"
+
+ - name: Bug cmd should be allowed
+ ansible.builtin.command:
+ cmd: echo "foo"
+ changed_when: false
+
+ - name: Bag another allowed form of command
+ ansible.builtin.command: "/etc/test.sh"
+ changed_when: false
+
+ - name: Bug 3090
+ community.docker.docker_container_exec:
+ container: foo
+ argv:
+ - /bin/bash
+ - "-c"
+ - "ls -lah > /dev/stderr"
+ chdir: /root
+ register: result
+
+ - name: "Bug 3138"
+ become: true
+ ansible.builtin.service:
+ name: "jenkins"
+ state: started
+ # 'use' is dropped by preprocessing ...
+ use: "{{ ansible_service_mgr }}"
+ changed_when: false
+
+ - name: "Bug 3152"
+ ansible.posix.synchronize:
+ src: .
+ dest: .
+ owner: false
+ group: false
+ use_ssh_args: true
+
+ - name: Create software directory (Windows module - Bug 3200)
+ ansible.windows.win_file:
+ path: "c:\\test_dir"
+ state: directory
+
+ - name: Ansible-lint for args rule should succeed (Bug - 3199)
+ vars:
+ copy_vars:
+ src: "args.json"
+ action: ansible.builtin.copy
+ args: "{{ copy_vars }}" # since, we're unable to analyze jinja, we skip this kind of checks
diff --git a/examples/playbooks/rule-avoid-implicit-fail.yml b/examples/playbooks/rule-avoid-implicit-fail.yml
new file mode 100644
index 0000000..ceaaeb4
--- /dev/null
+++ b/examples/playbooks/rule-avoid-implicit-fail.yml
@@ -0,0 +1,9 @@
+---
+- name: Example playbook
+ hosts: localhost
+ tasks:
+ - name: Write file content
+ ansible.builtin.copy:
+ content: { "foo": "bar" } # <-- avoid-implicit[copy-content]
+ dest: /tmp/foo.txt
+ mode: "0600"
diff --git a/examples/playbooks/rule-avoid-implicit-pass.yml b/examples/playbooks/rule-avoid-implicit-pass.yml
new file mode 100644
index 0000000..248fc8c
--- /dev/null
+++ b/examples/playbooks/rule-avoid-implicit-pass.yml
@@ -0,0 +1,9 @@
+---
+- name: Example playbook
+ hosts: localhost
+ tasks:
+ - name: Write file content
+ ansible.builtin.copy:
+ content: "Some {{ foo }}"
+ dest: /tmp/foo.txt
+ mode: "0600"
diff --git a/examples/playbooks/rule-command-instead-of-module-fail.yml b/examples/playbooks/rule-command-instead-of-module-fail.yml
new file mode 100644
index 0000000..38d7a29
--- /dev/null
+++ b/examples/playbooks/rule-command-instead-of-module-fail.yml
@@ -0,0 +1,15 @@
+---
+- name: Test fixture for command-instead-of-module
+ hosts: localhost
+ tasks:
+ - name: Run apt-get update # <-- 1
+ ansible.builtin.command: apt-get update
+ changed_when: false
+
+ - name: Restart sshd # <-- 2
+ ansible.builtin.command: systemctl restart sshd
+ changed_when: false
+
+ - name: Run yum update # <-- 3
+ ansible.builtin.command: yum update
+ changed_when: false
diff --git a/examples/playbooks/rule-command-instead-of-module-pass.yml b/examples/playbooks/rule-command-instead-of-module-pass.yml
new file mode 100644
index 0000000..c0a26e9
--- /dev/null
+++ b/examples/playbooks/rule-command-instead-of-module-pass.yml
@@ -0,0 +1,37 @@
+---
+- name: Test fixture for command-instead-of-module
+ hosts: localhost
+ tasks:
+ - name: Print current git branch
+ ansible.builtin.command: git branch
+ changed_when: false
+ - name: Print git log
+ ansible.builtin.command: git log
+ changed_when: false
+ - name: Install git lfs support
+ ansible.builtin.command: git lfs install
+ changed_when: false
+
+ - name: Show systemctl service status
+ ansible.builtin.command: systemctl status systemd-timesyncd
+ changed_when: false
+
+ - name: Show systemd environment
+ ansible.builtin.command: systemctl show-environment
+ changed_when: false
+
+ - name: Set systemd runlevel
+ ansible.builtin.command: systemctl set-default multi-user.target
+ changed_when: false
+
+ - name: Kill service using SIGUSR1
+ ansible.builtin.command: systemctl kill --signal=SIGUSR1 sshd
+ changed_when: false
+
+ - name: Clear yum cache
+ ansible.builtin.command: yum clean all
+ changed_when: false
+
+ - name: Clear yum cache
+ ansible.builtin.command: ""
+ changed_when: false
diff --git a/examples/playbooks/rule-command-instead-of-shell-fail.yml b/examples/playbooks/rule-command-instead-of-shell-fail.yml
new file mode 100644
index 0000000..278f5d7
--- /dev/null
+++ b/examples/playbooks/rule-command-instead-of-shell-fail.yml
@@ -0,0 +1,25 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: Shell no pipe
+ ansible.builtin.shell:
+ cmd: echo hello
+ changed_when: false
+
+ - name: Shell with jinja filter
+ ansible.builtin.shell:
+ cmd: echo {{ "hello" | upper }}
+ changed_when: false
+
+ - name: Shell with jinja filter (fqcn)
+ ansible.builtin.shell:
+ cmd: echo {{ "hello" | upper }}
+ changed_when: false
+
+ - name: Command with executable parameter
+ ansible.builtin.shell:
+ cmd: clear
+ args:
+ executable: /bin/bash
+ changed_when: false
diff --git a/examples/playbooks/rule-command-instead-of-shell-pass.yml b/examples/playbooks/rule-command-instead-of-shell-pass.yml
new file mode 100644
index 0000000..8bbaef3
--- /dev/null
+++ b/examples/playbooks/rule-command-instead-of-shell-pass.yml
@@ -0,0 +1,60 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: Shell with pipe
+ ansible.builtin.shell:
+ cmd: echo hello | true # noqa: risky-shell-pipe
+ changed_when: false
+
+ - name: Shell with redirect
+ ansible.builtin.shell:
+ cmd: echo hello > /tmp/hello
+ changed_when: false
+
+ - name: Chain two shell commands
+ ansible.builtin.shell:
+ cmd: echo hello && echo goodbye
+ changed_when: false
+
+ - name: Run commands in succession
+ ansible.builtin.shell:
+ cmd: echo hello ; echo goodbye
+ changed_when: false
+
+ - name: Use variables
+ ansible.builtin.shell:
+ cmd: echo $HOME $USER
+ changed_when: false
+
+ - name: Use * for globbing
+ ansible.builtin.shell:
+ cmd: ls foo*
+ changed_when: false
+
+ - name: Use ? for globbing
+ ansible.builtin.shell:
+ cmd: ls foo?
+ changed_when: false
+
+ - name: Use [] for globbing
+ ansible.builtin.shell:
+ cmd: ls foo[1,2,3]
+ changed_when: false
+
+ - name: Use shell generator
+ ansible.builtin.shell:
+ cmd: ls foo{.txt,.xml}
+ changed_when: false
+
+ - name: Use backticks
+ ansible.builtin.shell:
+ cmd: ls `ls foo*`
+ changed_when: false
+
+ - name: Use shell with cmd
+ ansible.builtin.shell:
+ cmd: |
+ set -x
+ ls foo?
+ changed_when: false
diff --git a/examples/playbooks/rule-deprecated-bare-vars-fail.yml b/examples/playbooks/rule-deprecated-bare-vars-fail.yml
new file mode 100644
index 0000000..7091f46
--- /dev/null
+++ b/examples/playbooks/rule-deprecated-bare-vars-fail.yml
@@ -0,0 +1,97 @@
+---
+- name: Fixture for deprecated-bare-vars rule
+ hosts: localhost
+ become: false
+ vars:
+ my_list:
+ - foo
+ - bar
+
+ my_list2:
+ - 1
+ - 2
+
+ my_list_of_dicts:
+ - foo: 1
+ bar: 2
+ - foo: 3
+ bar: 4
+
+ my_list_of_lists:
+ - "{{ my_list }}"
+ - "{{ my_list2 }}"
+
+ my_filenames:
+ - foo.txt
+ - bar.txt
+
+ my_dict:
+ foo: bar
+
+ tasks:
+ - name: Use with_items loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_items: my_list
+
+ - name: Use with_dict loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_dict: my_dict
+
+ ### Testing with_dict with a default empty dictionary
+ - name: Use with_dict loop using variable and default
+ ansible.builtin.debug:
+ msg: "{{ item.key }} - {{ item.value }}"
+ with_dict: uwsgi_ini | default({})
+
+ - name: Use with_nested loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} {{ item.1 }}"
+ with_nested:
+ - my_list
+ - "{{ my_list2 }}"
+
+ - name: Use with_nested loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} {{ item.1 }}"
+ with_nested: "my_list2"
+
+ - name: Use with_file loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_file: my_list
+
+ - name: Use with_fileglob loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_fileglob: my_list
+
+ - name: Use with_together loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} {{ item.1 }}"
+ with_together:
+ - my_list
+ - "{{ my_list2 }}"
+
+ - name: Use with_subelements loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item.0 }}"
+ with_subelements:
+ - my_list_of_dicts
+ - bar
+
+ - name: Use with_random_choice loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_random_choice: my_list
+
+ - name: Use with_first_found loop using bare variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_first_found: my_filenames
+
+ - name: Use with_indexed_items loop
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} {{ item.1 }}"
+ with_indexed_items: my_list
diff --git a/examples/playbooks/rule-deprecated-bare-vars-pass.yml b/examples/playbooks/rule-deprecated-bare-vars-pass.yml
new file mode 100644
index 0000000..c7e6521
--- /dev/null
+++ b/examples/playbooks/rule-deprecated-bare-vars-pass.yml
@@ -0,0 +1,168 @@
+---
+- name: Using bare variables success
+ hosts: localhost
+ become: false
+ vars:
+ my_list:
+ - foo
+ - bar
+
+ my_list2:
+ - 1
+ - 2
+
+ my_list_of_dicts:
+ - foo: 1
+ bar: 2
+ - foo: 3
+ bar: 4
+
+ my_list_of_lists:
+ - "{{ my_list }}"
+ - "{{ my_list2 }}"
+
+ my_filenames:
+ - foo.txt
+ - bar.txt
+
+ my_dict:
+ foo: bar
+
+ tasks:
+ ### Testing with_items loops
+ - name: Use with_items loop using static list
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_items:
+ - foo
+ - bar
+
+ - name: Use with_items using a static hash
+ ansible.builtin.debug:
+ msg: "{{ item.key }} - {{ item.value }}"
+ with_items:
+ - { key: foo, value: 1 }
+ - { key: bar, value: 2 }
+
+ - name: Use with_items loop using variable
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_items: "{{ my_list }}"
+
+ ### Testing with_nested loops
+ - name: Use with_nested loop using static lists
+ ansible.builtin.debug:
+ msg: "{{ item[0] }} - {{ item[1] }}"
+ with_nested:
+ - [foo, bar]
+ - ["1", "2", "3"]
+
+ - name: Use with_nested loop using variable list and static
+ ansible.builtin.debug:
+ msg: "{{ item[0] }} - {{ item[1] }}"
+ with_nested:
+ - "{{ my_list }}"
+ - ["1", "2", "3"]
+
+ ### Testing with_dict
+ - name: Use with_dict loop using variable
+ ansible.builtin.debug:
+ msg: "{{ item.key }} - {{ item.value }}"
+ with_dict: "{{ my_dict }}"
+
+ ### Testing with_dict with a default empty dictionary
+ - name: Use with_dict loop using variable and default
+ ansible.builtin.debug:
+ msg: "{{ item.key }} - {{ item.value }}"
+ with_dict: "{{ uwsgi_ini | default({}) }}"
+
+ ### Testing with_file
+ - name: Use with_file loop using static files list
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_file:
+ - foo.txt
+ - bar.txt
+
+ - name: Use with_file loop using list of filenames
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_file: "{{ my_filenames }}"
+
+ ### Testing with_fileglob
+ - name: Use with_fileglob loop using list of *.txt
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_fileglob:
+ - "*.txt"
+
+ ### Testing non-list form of with_fileglob
+ - name: Use with_fileglob loop using single value *.txt
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_fileglob: "*.txt"
+
+ ### Testing non-list form of with_fileglob with trailing templated pattern
+ - name: Use with_fileglob loop using templated pattern
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_fileglob: foo{{ glob }}
+
+ ### Testing with_together
+ - name: Use with_together loop using variable lists
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} - {{ item.1 }}"
+ with_together:
+ - "{{ my_list }}"
+ - "{{ my_list2 }}"
+
+ - name: Use with_subelements loop
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_subelements:
+ - "{{ my_list_of_dicts }}"
+ - bar
+
+ - name: Use with_sequence loop
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_sequence: count=2
+
+ - name: Use with_random_choice loop
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_random_choice: "{{ my_list }}"
+
+ - name: Use with_first_found loop with static files list
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_first_found:
+ - foo.txt
+ - bar.txt
+
+ - name: Use with_first_found loop with list of filenames
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_first_found: "{{ my_filenames }}"
+
+ - name: Use with_indexed_items loop
+ ansible.builtin.debug:
+ msg: "{{ item.0 }} {{ item.1 }}"
+ with_indexed_items: "{{ my_list }}"
+
+ - name: Use with_ini loop
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_ini: value[1-2] section=section1 file=foo.ini re=true
+
+ - name: Use with_inventory_hostnames loop
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_inventory_hostnames: all
+
+ - name: Test more complex jinja is also allowed
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_items: >-
+ {%- set ns = [1, 1, 2] -%}
+ {{- ns.keys | unique -}}
diff --git a/examples/playbooks/rule-deprecated-command-syntax.yml b/examples/playbooks/rule-deprecated-command-syntax.yml
new file mode 100644
index 0000000..a7b9807
--- /dev/null
+++ b/examples/playbooks/rule-deprecated-command-syntax.yml
@@ -0,0 +1,7 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: Shell with pipe
+ ansible.builtin.command: creates=/tmp/foo touch /tmp/foo
+ changed_when: false
diff --git a/examples/playbooks/rule-deprecated-local-action-fail.yml b/examples/playbooks/rule-deprecated-local-action-fail.yml
new file mode 100644
index 0000000..c8eeb11
--- /dev/null
+++ b/examples/playbooks/rule-deprecated-local-action-fail.yml
@@ -0,0 +1,7 @@
+---
+- name: Fixture for deprecated-local-action
+ hosts: localhost
+ tasks:
+ - name: Task example
+ local_action:
+ module: ansible.builtin.debug
diff --git a/examples/playbooks/rule-empty-string-compare-fail.yml b/examples/playbooks/rule-empty-string-compare-fail.yml
new file mode 100644
index 0000000..7b4be85
--- /dev/null
+++ b/examples/playbooks/rule-empty-string-compare-fail.yml
@@ -0,0 +1,16 @@
+---
+- name: Empty String Compare Fail
+ hosts: all
+ tasks:
+ - name: Shut down # noqa no-changed-when
+ ansible.builtin.command: /sbin/shutdown -t now
+ when: ansible_os_family == ""
+ - name: Shut down # noqa no-changed-when
+ ansible.builtin.command: /sbin/shutdown -t now
+ when: ansible_os_family !=""
+ - name: Shut down # noqa no-changed-when
+ ansible.builtin.command: /sbin/shutdown -t now
+ when: false
+ - name: Shut down # noqa no-changed-when
+ ansible.builtin.command: /sbin/shutdown -t now
+ when: [ansible_os_family == ""]
diff --git a/examples/playbooks/rule-empty-string-compare-pass.yml b/examples/playbooks/rule-empty-string-compare-pass.yml
new file mode 100644
index 0000000..aa335de
--- /dev/null
+++ b/examples/playbooks/rule-empty-string-compare-pass.yml
@@ -0,0 +1,16 @@
+---
+- name: Empty string compare success
+ hosts: all
+ tasks:
+ - name: Shut down
+ ansible.builtin.shell: |
+ /sbin/shutdown -t now
+ echo $var == ""
+ changed_when: false
+ when: ansible_os_family
+ - name: Shut down
+ ansible.builtin.shell: |
+ /sbin/shutdown -t now
+ echo $var == ""
+ changed_when: false
+ when: [ansible_os_family]
diff --git a/examples/playbooks/rule-fqcn-fail.yml b/examples/playbooks/rule-fqcn-fail.yml
new file mode 100644
index 0000000..8015cc2
--- /dev/null
+++ b/examples/playbooks/rule-fqcn-fail.yml
@@ -0,0 +1,14 @@
+---
+- name: Fixture
+ hosts: localhost
+ collections:
+ - community.general
+ tasks:
+ - name: Shell (fqcn[action-core]) # noqa: command-instead-of-shell
+ shell: echo This rule should get matched by the fqcn rule
+ changed_when: false
+ - name: Shell (fqcn[action])
+ ini_file:
+ section: foo
+ path: /tmp/test.ini
+ mode: "0644"
diff --git a/examples/playbooks/rule-fqcn-pass.yml b/examples/playbooks/rule-fqcn-pass.yml
new file mode 100644
index 0000000..eafd653
--- /dev/null
+++ b/examples/playbooks/rule-fqcn-pass.yml
@@ -0,0 +1,13 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: Shell (fqcn) # noqa: command-instead-of-shell
+ changed_when: false
+ ansible.builtin.shell: echo This rule should not get matched by the fqcn rule
+ - name: Use FQCN with more than 3 parts
+ community.general.system.sudoers:
+ name: should-not-be-here
+ state: absent
+ - name: Command with legacy FQCN
+ ansible.legacy.command: echo This rule should not get matched by the fqcn rule
diff --git a/examples/playbooks/rule-jinja-fail.yml b/examples/playbooks/rule-jinja-fail.yml
new file mode 100644
index 0000000..c7bf5ba
--- /dev/null
+++ b/examples/playbooks/rule-jinja-fail.yml
@@ -0,0 +1,12 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: A block used to check that we do not identify error at correct level
+ block:
+ - name: Foo # <-- this is valid jinja2
+ ansible.builtin.debug:
+ foo: "{{ 1 }}" # <-- jinja2[spacing]
+ msg: "{{ 'a' b }}" # <-- jinja2[invalid]
+# It should be noted that even ansible --syntax-check fails to spot the jinja
+# error above, but ansible will throw a runtime error when running
diff --git a/examples/playbooks/rule-jinja-pass.yml b/examples/playbooks/rule-jinja-pass.yml
new file mode 100644
index 0000000..cbdfee6
--- /dev/null
+++ b/examples/playbooks/rule-jinja-pass.yml
@@ -0,0 +1,83 @@
+---
+# https://github.com/ansible/ansible-lint/issues/2464
+# https://github.com/ansible/ansible-lint/issues/2462
+# https://github.com/ansible/ansible-lint/issues/2459
+- name: Fixture to test various jinja parsing bugs that we should ignore
+ hosts: localhost
+ tasks:
+ - name: Foo {{ buildset_registry.host | ipwrap }}
+ ansible.builtin.debug:
+ msg: "{{ lookup('template', 'lookup/redis_server__env_ports.j2') | from_yaml }}"
+ loop: "{{ github_release_query.results | subelements('json.assets', {'skip_missing': True}) }}"
+ - name: Zoo
+ ansible.builtin.debug:
+ msg: "{{ lookup('ansible.builtin.ini', 'SOME_VAR', type='properties', file='/tmp/some-file') }}"
+
+ - name: Generate Dovecot main configuration file
+ ansible.builtin.template:
+ src: '{{ lookup("template_src", "etc/dovecot/dovecot.conf.j2") }}'
+ dest: "/etc/dovecot/dovecot.conf"
+ owner: "root"
+ group: "dovecot"
+ mode: "0640"
+ - name: Bug https://github.com/ansible/ansible-lint/issues/2569
+ ansible.builtin.include_tasks:
+ file: /dev/null
+ vars:
+ ns_vars: {}
+ x: "{{ lookup('ansible.builtin.template', 'namespace.yaml.j2', template_vars=ns_vars) | from_yaml }}"
+ - name: Bug https://github.com/ansible/ansible-lint/issues/3048
+ ansible.builtin.set_fact:
+ x: "{{ y.json | community.general.json_query(edition.version) }}"
+
+# https://github.com/ansible/ansible-lint/issues/2697
+- name: Test linter
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Passed linter
+ ansible.builtin.debug:
+ msg: "{{ test | to_json }}"
+ vars:
+ test:
+ one: two
+ param: "{{ ansible_host }}"
+ - name: Failed linter
+ ansible.builtin.debug:
+ msg: "{{ test | to_json }}"
+ vars:
+ test:
+ one: two
+ param: no jinja
+
+- name: Bug https://github.com/ansible/ansible-lint/issues/3048
+ hosts: localhost
+ tasks:
+ - name: "Test for bug #3048"
+ ansible.builtin.debug:
+ msg: "{{ __my_var | mandatory }}"
+ loop: "{{ a_var }}"
+ loop_control:
+ loop_var: __my_var
+ vars:
+ a_var:
+ - one
+
+- name: Bugs
+ hosts: localhost
+ tasks:
+ - name: Bug https://github.com/ansible/ansible-lint/issues/3082
+ ansible.builtin.copy:
+ content: "{{ item.cfg | to_nice_yaml(indent=2, width=9999) }}"
+ dest: "/tmp/{{ item.name }}.yaml"
+ mode: "0640"
+ with_items:
+ - name: file2
+
+ - name: Bug https://github.com/ansible/ansible-lint/issues/3136
+ ansible.builtin.debug:
+ msg: "IP is {{ foo | ansible.utils.ipaddr('address') }}"
+
+ - name: "Bug https://github.com/ansible/ansible-lint/issues/3155"
+ ansible.builtin.debug:
+ msg: "Is changed:{{ date_cmd is changed }}"
diff --git a/examples/playbooks/rule-key-order-fail.yml b/examples/playbooks/rule-key-order-fail.yml
new file mode 100644
index 0000000..a83514a
--- /dev/null
+++ b/examples/playbooks/rule-key-order-fail.yml
@@ -0,0 +1,30 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - no_log: true
+ ansible.builtin.command: echo hello
+ name: Task with no_log on top
+ changed_when: false
+ - when: true
+ name: Task with when on top
+ ansible.builtin.command: echo hello
+ changed_when: false
+ - delegate_to: localhost
+ name: Delegate_to on top
+ ansible.builtin.command: echo hello
+ changed_when: false
+ - loop:
+ - 1
+ - 2
+ name: Loopy
+ ansible.builtin.command: echo {{ item }}
+ changed_when: false
+ - become: true
+ name: Become first
+ ansible.builtin.command: echo hello
+ changed_when: false
+ - register: test
+ ansible.builtin.command: echo hello
+ name: Register first
+ changed_when: false
diff --git a/examples/playbooks/rule-key-order-pass.yml b/examples/playbooks/rule-key-order-pass.yml
new file mode 100644
index 0000000..eb141e5
--- /dev/null
+++ b/examples/playbooks/rule-key-order-pass.yml
@@ -0,0 +1,16 @@
+---
+- name: Fixture for key-order rule
+ hosts: localhost
+ tasks:
+ - name: Test
+ ansible.builtin.command: echo "test"
+ changed_when: false
+ - name: Test2
+ ansible.builtin.debug:
+ msg: "Debug without a name"
+ - name: Flush handlers
+ ansible.builtin.meta: flush_handlers
+ - no_log: true # noqa: key-order[task] command-instead-of-shell
+ ansible.builtin.shell: echo hello
+ name: Task with no_log on top
+ changed_when: false
diff --git a/examples/playbooks/rule-name-casing.yml b/examples/playbooks/rule-name-casing.yml
new file mode 100644
index 0000000..1b2efb8
--- /dev/null
+++ b/examples/playbooks/rule-name-casing.yml
@@ -0,0 +1,10 @@
+---
+- name: Fixture for src/ansiblelint/rules/name.py::test_rule_name_lowercase
+ hosts: all
+ tasks:
+ - name: this task has a name is not correctly capitalized
+ ansible.builtin.command: echo "Hello World"
+ changed_when: false
+ - name: 测试 should not trigger name[case] rule!
+ ansible.builtin.command: echo "Hello World"
+ changed_when: false
diff --git a/examples/playbooks/rule-name-missing-fail.yml b/examples/playbooks/rule-name-missing-fail.yml
new file mode 100644
index 0000000..4ea543e
--- /dev/null
+++ b/examples/playbooks/rule-name-missing-fail.yml
@@ -0,0 +1,11 @@
+---
+- hosts: all # <-- name[missing]
+ tasks:
+ - ansible.builtin.command: echo "no name" # <-- name[missing]
+ changed_when: false
+ - name: "" # <-- name[missing]
+ ansible.builtin.command: echo "empty name"
+ changed_when: false
+ - ansible.builtin.debug: # <-- name[missing]
+ msg: Debug without a name
+ - ansible.builtin.meta: flush_handlers # <-- name[missing]
diff --git a/examples/playbooks/rule-name-missing-pass.yml b/examples/playbooks/rule-name-missing-pass.yml
new file mode 100644
index 0000000..965a80a
--- /dev/null
+++ b/examples/playbooks/rule-name-missing-pass.yml
@@ -0,0 +1,12 @@
+---
+- name: Play for testing name[missing] rule
+ hosts: all
+ tasks:
+ - name: This task has a name
+ ansible.builtin.command: echo "Hello World" # noqa: no-free-form
+ changed_when: false
+ - name: Debug task with name
+ ansible.builtin.debug: msg="Hello World" # noqa: no-free-form
+ - name: Flush handler with name
+ ansible.builtin.meta: flush_handlers
+ changed_when: false
diff --git a/examples/playbooks/rule-name-play-fail.yml b/examples/playbooks/rule-name-play-fail.yml
new file mode 100644
index 0000000..5e42fa0
--- /dev/null
+++ b/examples/playbooks/rule-name-play-fail.yml
@@ -0,0 +1,3 @@
+---
+- hosts: localhost # <-- name[missing]
+ tasks: []
diff --git a/examples/playbooks/rule-name-templated-fail.yml b/examples/playbooks/rule-name-templated-fail.yml
new file mode 100644
index 0000000..8a4f156
--- /dev/null
+++ b/examples/playbooks/rule-name-templated-fail.yml
@@ -0,0 +1,13 @@
+---
+- name: Fixture for src/ansiblelint/rules/name.py::test_name_template(
+ hosts: all
+ tasks:
+ - name: This task {{ sampleService }} name is not correctly templated
+ ansible.builtin.command: echo "Hello World"
+ changed_when: false
+ - name: This task is correctly templated {{ sampleService }}
+ ansible.builtin.command: echo "Hello World"
+ changed_when: false
+ - name: This task is correctly templated '{{ sampleService }}'
+ ansible.builtin.command: echo "Hello World"
+ changed_when: false
diff --git a/examples/playbooks/rule-no-changed-when-fail.yml b/examples/playbooks/rule-no-changed-when-fail.yml
new file mode 100644
index 0000000..1f994b8
--- /dev/null
+++ b/examples/playbooks/rule-no-changed-when-fail.yml
@@ -0,0 +1,15 @@
+---
+- name: Fixture for no-changed-when (fail with 3 occurrences)
+ hosts: all
+ tasks:
+ - name: Register command output, but cat still does not change anything
+ ansible.builtin.command: cat {{ my_file | quote }}
+ register: my_output
+ - name: Block level 1
+ block:
+ - name: Block level 2
+ block:
+ - name: Basic command task, should fail
+ ansible.builtin.command: cat my_file
+ - name: Basic shell task, should fail
+ shell: cat my_file # noqa: fqcn command-instead-of-shell
diff --git a/examples/playbooks/rule-no-changed-when-pass.yml b/examples/playbooks/rule-no-changed-when-pass.yml
new file mode 100644
index 0000000..9681e06
--- /dev/null
+++ b/examples/playbooks/rule-no-changed-when-pass.yml
@@ -0,0 +1,23 @@
+---
+- name: Fixture for no-changed-when (pass)
+ hosts: all
+ tasks:
+ - name: Handle command output with return code # noqa: command-instead-of-shell
+ ansible.builtin.command: cat {{ my_file | quote }}
+ register: my_output
+ changed_when: my_output.rc != 0
+
+ - name: Handle shell output with return code # noqa: command-instead-of-shell
+ ansible.builtin.shell: cat {{ my_file | quote }}
+ register: my_output
+ changed_when: my_output.rc != 0
+
+ - name: Handle shell output with false changed_when # noqa: command-instead-of-shell
+ ansible.builtin.shell: cat {{ my_file | quote }}
+ register: my_output
+ changed_when: false
+
+ - name: Command with argument
+ command: createfile.sh # noqa: fqcn
+ args:
+ creates: /tmp/????unknown_files????
diff --git a/examples/playbooks/rule-no-free-form-fail.yml b/examples/playbooks/rule-no-free-form-fail.yml
new file mode 100644
index 0000000..8360608
--- /dev/null
+++ b/examples/playbooks/rule-no-free-form-fail.yml
@@ -0,0 +1,14 @@
+---
+- name: Example with discouraged free-form syntax
+ hosts: localhost
+ tasks:
+ - name: Create a placefolder file
+ ansible.builtin.command: chdir=/tmp touch foo # <-- don't use shorthand
+ changed_when: false
+ - name: Use raw to echo
+ ansible.builtin.raw: executable=/bin/bash echo foo # <-- don't use executable=
+ changed_when: false
+ - name: Testing anything else passed to raw except for string
+ ansible.builtin.raw:
+ args: "123"
+ changed_when: false
diff --git a/examples/playbooks/rule-no-free-form-pass.yml b/examples/playbooks/rule-no-free-form-pass.yml
new file mode 100644
index 0000000..36d359d
--- /dev/null
+++ b/examples/playbooks/rule-no-free-form-pass.yml
@@ -0,0 +1,19 @@
+---
+- name: Example with discouraged free-form syntax
+ hosts: localhost
+ tasks:
+ - name: Create a placefolder file
+ ansible.builtin.command:
+ cmd: touch foo
+ chdir: /tmp
+ changed_when: false
+ - name: Use raw to echo
+ ansible.builtin.raw: echo foo
+ args:
+ executable: /bin/bash
+ changed_when: false
+ - name: Configure locale
+ # https://github.com/ansible/ansible-lint/issues/2573
+ ansible.builtin.command: localectl set-locale LANG=en_GB.UTF-8
+ when: not ansible_check_mode
+ changed_when: false
diff --git a/examples/playbooks/rule-no-handler-fail.yml b/examples/playbooks/rule-no-handler-fail.yml
new file mode 100644
index 0000000..3bc23a3
--- /dev/null
+++ b/examples/playbooks/rule-no-handler-fail.yml
@@ -0,0 +1,15 @@
+---
+- name: Example of no-handler rule
+ hosts: localhost
+ tasks:
+ - name: Register result of a task
+ ansible.builtin.copy:
+ dest: "/tmp/placeholder"
+ content: "Ansible made this!"
+ mode: "0600"
+ register: result # <-- we register the result of the task
+
+ - name: Second command to run
+ ansible.builtin.debug:
+ msg: The placeholder file was modified!
+ when: result.changed # <-- this triggers no-handler rule
diff --git a/examples/playbooks/rule-no-handler-pass.yml b/examples/playbooks/rule-no-handler-pass.yml
new file mode 100644
index 0000000..af6a726
--- /dev/null
+++ b/examples/playbooks/rule-no-handler-pass.yml
@@ -0,0 +1,15 @@
+---
+- name: Example of no-handler rule
+ hosts: localhost
+ tasks:
+ - name: Register result of a task
+ ansible.builtin.copy:
+ dest: "/tmp/placeholder"
+ content: "Ansible made this!"
+ mode: "0600"
+ notify:
+ - Second command to run # <-- handler will run only when file is changed
+ handlers:
+ - name: Second command to run
+ ansible.builtin.debug:
+ msg: The placeholder file was modified!
diff --git a/examples/playbooks/rule-no-jinja-when-fail.yml b/examples/playbooks/rule-no-jinja-when-fail.yml
new file mode 100644
index 0000000..15778ea
--- /dev/null
+++ b/examples/playbooks/rule-no-jinja-when-fail.yml
@@ -0,0 +1,21 @@
+---
+- name: One
+ hosts: all
+ tasks:
+ - name: Test when with jinja2 # noqa: jinja[spacing]
+ ansible.builtin.debug:
+ msg: text
+ when: "{{ false }}"
+
+- name: Two
+ hosts: all
+ roles:
+ - role: test
+ when: "{{ '1' = '1' }}"
+
+- name: Three
+ hosts: all
+ roles:
+ - role: test
+ when:
+ - "{{ '1' = '1' }}"
diff --git a/examples/playbooks/rule-no-jinja-when-pass.yml b/examples/playbooks/rule-no-jinja-when-pass.yml
new file mode 100644
index 0000000..b9d02f5
--- /dev/null
+++ b/examples/playbooks/rule-no-jinja-when-pass.yml
@@ -0,0 +1,17 @@
+---
+- name: Test fixture for no-jinja-when
+ hosts: all
+ tasks:
+ - name: Test when
+ ansible.builtin.debug:
+ msg: text
+ when: true
+ - name: Test when 2
+ ansible.builtin.debug:
+ msg: text2
+ when: 1 = 1
+ - name: Three
+ ansible.builtin.debug:
+ msg: text2
+ when:
+ - "false"
diff --git a/examples/playbooks/rule-no-prompting.yml b/examples/playbooks/rule-no-prompting.yml
new file mode 100644
index 0000000..5f74303
--- /dev/null
+++ b/examples/playbooks/rule-no-prompting.yml
@@ -0,0 +1,27 @@
+---
+- name: Fixture for testing no-prompting rule, lines 5,17
+ hosts: all
+ vars_prompt:
+ - name: username
+ prompt: What is your username?
+ private: false
+
+ - name: password
+ prompt: What is your password?
+
+ tasks:
+ - name: Pause for 5 minutes to build app cache
+ ansible.builtin.pause:
+ minutes: 5 # should not trigger because minutes is mentioned
+
+ - name: A helpful reminder of what to look out for post-update
+ ansible.builtin.pause:
+ # should trigger no-prompting as neither seconds/minutes are mentioned
+ prompt: "Make sure org.foo.FooOverload exception is not present"
+
+- name: Fixture for testing if no vars_prompt is provided, lines 34-36
+ hosts: all
+ tasks:
+ - name: Pause for 5 minutes to build app cache
+ ansible.builtin.pause:
+ minutes: 5 # should not trigger because minutes is mentioned
diff --git a/examples/playbooks/rule-no-tabs.yml b/examples/playbooks/rule-no-tabs.yml
new file mode 100644
index 0000000..4621096
--- /dev/null
+++ b/examples/playbooks/rule-no-tabs.yml
@@ -0,0 +1,20 @@
+---
+- name: Fixture for no-tabs rule
+ hosts: localhost
+ tasks:
+ - name: Should not trigger no-tabs rules
+ ansible.builtin.lineinfile:
+ path: some.txt
+ regexp: ^\t$
+ line: string with \t inside
+ - name: Foo
+ ansible.builtin.debug:
+ msg: "Presence of \t should trigger no-tabs here."
+ - name: Key has a tab
+ ansible.builtin.debug:
+ "ms\tg": "The associated key has \t and should trigger no-tabs here."
+ - name: Should not trigger no-tabs rules # noqa fqcn
+ lineinfile:
+ path: some.txt
+ regexp: ^\t$
+ line: string with \t inside
diff --git a/examples/playbooks/rule-only-builtins.yml b/examples/playbooks/rule-only-builtins.yml
new file mode 100644
index 0000000..18f0f04
--- /dev/null
+++ b/examples/playbooks/rule-only-builtins.yml
@@ -0,0 +1,12 @@
+---
+- name: Fixture for examples/playbooks/rule-only-builtins.yml
+ hosts: localhost
+ tasks:
+ - name: Sysctl # noqa: args[module]
+ # while next module is mocked in our config, we still want to see that
+ # only-builtins rules gets matched
+ fake_namespace.fake_collection.fake_module:
+ name: vm.swappiness
+ value: "5"
+ - name: Some task # noqa: args[module]
+ zuul_return: {}
diff --git a/examples/playbooks/rule-partial-become-without-become-fail.yml b/examples/playbooks/rule-partial-become-without-become-fail.yml
new file mode 100644
index 0000000..da48b2f
--- /dev/null
+++ b/examples/playbooks/rule-partial-become-without-become-fail.yml
@@ -0,0 +1,28 @@
+---
+- hosts: localhost
+ name: Use of become_user without become play
+ become_user: root
+
+ tasks:
+ - ansible.builtin.debug:
+ msg: hello
+
+- hosts: localhost
+
+ tasks:
+ - name: Use of become_user without become task
+ ansible.builtin.command: whoami
+ become_user: postgres
+ changed_when: false
+
+- hosts: localhost
+
+ tasks:
+ - name: A block with become and become_user on different tasks
+ block:
+ - name: Sample become
+ become: true
+ ansible.builtin.command: whoami
+ - name: Sample become_user
+ become_user: postgres
+ ansible.builtin.command: whoami
diff --git a/examples/playbooks/rule-partial-become-without-become-pass.yml b/examples/playbooks/rule-partial-become-without-become-pass.yml
new file mode 100644
index 0000000..e1ae189
--- /dev/null
+++ b/examples/playbooks/rule-partial-become-without-become-pass.yml
@@ -0,0 +1,35 @@
+---
+- hosts: localhost
+ become_user: root
+ become: true
+
+ tasks:
+ - ansible.builtin.debug:
+ msg: hello
+
+- hosts: localhost
+
+ tasks:
+ - name: Foo
+ ansible.builtin.command: whoami
+ become_user: postgres
+ become: true
+ changed_when: false
+
+- hosts: localhost
+ become: true
+
+ tasks:
+ - name: Accepts a become from higher scope
+ ansible.builtin.command: whoami
+ become_user: postgres
+ changed_when: false
+
+- hosts: localhost
+ become_user: postgres
+
+ tasks:
+ - name: Accepts a become from a lower scope
+ ansible.builtin.command: whoami
+ become: true
+ changed_when: false
diff --git a/examples/playbooks/rule-risky-file-permissions-fail.yml b/examples/playbooks/rule-risky-file-permissions-fail.yml
new file mode 100644
index 0000000..643f598
--- /dev/null
+++ b/examples/playbooks/rule-risky-file-permissions-fail.yml
@@ -0,0 +1,91 @@
+# Fixture for RiskyFilePermissionsRule should return 11 occurrences
+---
+- name: FAIL_INI_PRESERVE
+ hosts: all
+ tasks:
+ - name: Ini_file does not accept preserve mode
+ community.general.ini_file:
+ path: foo
+ create: true
+ mode: preserve
+ section: bar
+
+- name: FAIL_INI_PERMISSION
+ hosts: all
+ tasks:
+ - name: Permissions needed if create is used
+ community.general.ini_file:
+ path: foo
+ create: true
+ section: bar
+
+- name: FAIL_PRESERVE_MODE
+ hosts: all
+ tasks:
+ - name: File does not allow preserve value for mode
+ ansible.builtin.file:
+ path: foo
+ mode: preserve
+
+- name: FAIL_MISSING_PERMISSIONS_TOUCH
+ hosts: all
+ tasks:
+ - name: Permissions missing and might create file # noqa: fqcn[action-core]
+ file:
+ path: foo
+ state: touch
+ - name: Permissions missing and might create file (fqcn)
+ ansible.builtin.file:
+ path: foo
+ state: touch
+
+- name: FAIL_MISSING_PERMISSIONS_DIRECTORY
+ hosts: all
+ tasks:
+ - name: Permissions missing and might create directory # noqa: fqcn[action-core]
+ file:
+ path: foo
+ state: directory
+ - name: Lineinfile when create is true (fqcn)
+ ansible.builtin.lineinfile:
+ path: foo
+ create: true
+ line: some content here
+
+- name: FAIL_MISSING_PERMISSIONS_GET_URL
+ hosts: all
+ tasks:
+ - name: Permissions missing
+ # noqa: fqcn[action-core]
+ get_url:
+ url: http://foo
+ dest: foo
+
+- name: FAIL_LINEINFILE_CREATE
+ hosts: all
+ tasks:
+ - name: Lineinfile when create is true
+ ansible.builtin.lineinfile:
+ path: foo
+ create: true
+ line: some content here
+
+- name: FAIL_REPLACE_PRESERVE
+ hosts: all
+ tasks:
+ - name: Replace does not allow preserve mode # noqa: fqcn[action-core]
+ replace:
+ path: foo
+ mode: preserve
+ regexp: foo
+
+- name: FAIL_PERMISSION_COMMENT
+ hosts: all
+ tasks:
+ - name: Permissions is only a comment # noqa: fqcn[action-core]
+ file:
+ path: foo
+ owner: root
+ group: root
+ state: directory
+ # mode: 0755
diff --git a/examples/playbooks/rule-risky-file-permissions-pass.yml b/examples/playbooks/rule-risky-file-permissions-pass.yml
new file mode 100644
index 0000000..7611708
--- /dev/null
+++ b/examples/playbooks/rule-risky-file-permissions-pass.yml
@@ -0,0 +1,77 @@
+# Fixture for RiskyFilePermissionsRule should pass
+---
+- name: SUCCESS_PERMISSIONS_PRESENT
+ hosts: all
+ tasks:
+ - name: Permissions not missing and numeric
+ ansible.builtin.file:
+ path: foo
+ mode: "0600"
+
+- name: SUCCESS_PERMISSIONS_PRESENT_GET_URL
+ hosts: all
+ tasks:
+ - name: Permissions not missing and numeric
+ ansible.builtin.get_url:
+ url: http://foo
+ dest: foo
+ mode: "0600"
+
+- name: SUCCESS_ABSENT_STATE
+ hosts: all
+ tasks:
+ - name: Permissions missing while state is absent is fine
+ ansible.builtin.file:
+ path: foo
+ state: absent
+
+- name: SUCCESS_DEFAULT_STATE
+ hosts: all
+ tasks:
+ - name: Permissions missing while state is file (default) is fine
+ ansible.builtin.file:
+ path: foo
+
+- name: SUCCESS_LINK_STATE
+ hosts: all
+ tasks:
+ - name: Permissions missing while state is link is fine
+ ansible.builtin.file:
+ path: foo2
+ src: foo
+ state: link
+
+- name: SUCCESS_CREATE_FALSE
+ hosts: all
+ tasks:
+ - name: File edit when create is false
+ ansible.builtin.lineinfile:
+ path: foo
+ create: false
+ line: some content here
+
+- name: SUCCESS_REPLACE
+ hosts: all
+ tasks:
+ - name: Replace should not require mode
+ ansible.builtin.replace:
+ path: foo
+ regexp: foo
+
+- name: SUCCESS_RECURSE
+ hosts: all
+ tasks:
+ - name: File with recursive does not require mode
+ ansible.builtin.file:
+ state: directory
+ recurse: true
+ path: foo
+ - name: Permissions not missing and numeric (fqcn)
+ ansible.builtin.file:
+ path: bar
+ mode: "755" # noqa: risky-octal
+ - name: File edit when create is false (fqcn)
+ ansible.builtin.lineinfile:
+ path: foo
+ create: false
+ line: some content here
diff --git a/examples/playbooks/rule-risky-octal-fail.yml b/examples/playbooks/rule-risky-octal-fail.yml
new file mode 100644
index 0000000..9e4a3bf
--- /dev/null
+++ b/examples/playbooks/rule-risky-octal-fail.yml
@@ -0,0 +1,25 @@
+---
+- name: Fixture for testing risky-octal rule
+ hosts: hosts
+ vars:
+ varset: varset
+ tasks:
+ - name: Octal permissions test fail (600)
+ ansible.builtin.file:
+ path: foo
+ mode: 600
+
+ - name: Octal permissions test fail (710)
+ ansible.builtin.file:
+ path: foo
+ mode: 710
+
+ - name: Octal permissions test fail (123)
+ ansible.builtin.file:
+ path: foo
+ mode: 123
+
+ - name: Octal permissions test fail (2000)
+ ansible.builtin.file:
+ path: bar
+ mode: 2000
diff --git a/examples/playbooks/rule-risky-octal-pass.yml b/examples/playbooks/rule-risky-octal-pass.yml
new file mode 100644
index 0000000..b900990
--- /dev/null
+++ b/examples/playbooks/rule-risky-octal-pass.yml
@@ -0,0 +1,42 @@
+---
+- name: Fixture for testing risky-octal rule
+ hosts: hosts
+ vars:
+ varset: varset
+ tags:
+ - no-free-form
+ tasks:
+ - name: Octal permissions test success (0600)
+ ansible.builtin.file:
+ path: foo
+ mode: "0600"
+
+ - name: Octal permissions test success (0000)
+ ansible.builtin.file:
+ path: foo
+ mode: "0000"
+
+ - name: Octal permissions test success (02000)
+ ansible.builtin.file:
+ path: bar
+ mode: "02000"
+
+ - name: Octal permissions test success (02751)
+ ansible.builtin.file:
+ path: bar
+ mode: "02751"
+
+ - name: Octal permissions test success (0777)
+ ansible.builtin.file: path=baz mode=0777 # noqa: no-free-form
+
+ - name: Octal permissions test success (0711)
+ ansible.builtin.file: path=baz mode=0711 # noqa: no-free-form
+
+ - name: Permissions test success (0777)
+ ansible.builtin.file: path=baz mode=u+rwx # noqa: no-free-form
+
+ - name: Octal permissions test success (777)
+ ansible.builtin.file: path=baz mode=777 # noqa: no-free-form
+
+ - name: Octal permissions test success (733)
+ ansible.builtin.file: path=baz mode=733 # noqa: no-free-form
diff --git a/examples/playbooks/rule-risky-shell-pipe-fail.yml b/examples/playbooks/rule-risky-shell-pipe-fail.yml
new file mode 100644
index 0000000..d727bc4
--- /dev/null
+++ b/examples/playbooks/rule-risky-shell-pipe-fail.yml
@@ -0,0 +1,17 @@
+---
+- name: Test fixture for risky-shell-pipe
+ hosts: localhost
+ become: false
+ tasks:
+ - name: Pipeline without pipefail
+ ansible.builtin.shell: false | cat
+ changed_when: false
+
+ - name: Pipeline with or and pipe, no pipefail
+ ansible.builtin.shell: false || true | cat
+ changed_when: false
+
+ - name: Another one
+ ansible.builtin.shell: |
+ df | grep '/dev'
+ changed_when: false
diff --git a/examples/playbooks/rule-risky-shell-pipe-pass.yml b/examples/playbooks/rule-risky-shell-pipe-pass.yml
new file mode 100644
index 0000000..386e8e8
--- /dev/null
+++ b/examples/playbooks/rule-risky-shell-pipe-pass.yml
@@ -0,0 +1,70 @@
+---
+- name: Test fixture for risky-shell-pipe
+ hosts: localhost
+ become: false
+ tasks:
+ - name: Pipeline with pipefail
+ ansible.builtin.shell: set -o pipefail && false | cat
+ changed_when: false
+
+ - name: Pipeline with pipefail, multi-line
+ ansible.builtin.shell: |
+ set -o pipefail
+ false | cat
+ changed_when: false
+
+ - name: Pipeline with pipefail, complex set
+ ansible.builtin.shell: |
+ set -e -x -o pipefail
+ false | cat
+ changed_when: false
+
+ - name: Pipeline with pipefail, complex set
+ ansible.builtin.shell: |
+ set -e -x -o pipefail
+ false | cat
+ changed_when: false
+
+ - name: Pipeline with pipefail, complex set
+ ansible.builtin.shell: |
+ set -eo pipefail
+ false | cat
+ changed_when: false
+
+ - name: Pipeline with pipefail not at first line
+ ansible.builtin.shell: |
+ echo foo
+ set -eo pipefail
+ false | cat
+ changed_when: false
+
+ - name: Pipeline without pipefail, ignoring errors # noqa: risky-shell-pipe
+ ansible.builtin.shell: false | cat
+ failed_when: false
+ changed_when: false
+
+ - name: Non-pipeline without pipefail # noqa: command-instead-of-shell
+ ansible.builtin.shell: "true"
+ changed_when: false
+
+ - name: Command without pipefail
+ ansible.builtin.command: "true"
+ changed_when: false
+
+ - name: Shell with or
+ ansible.builtin.shell: false || true
+ changed_when: false
+
+ - name: Another one
+ ansible.builtin.shell: |
+ set -o pipefail
+ df | grep '/dev'
+ changed_when: false
+
+ - name: "PowerShell with pipefail should be ok, bug #3161"
+ # https://github.com/ansible/ansible-lint/issues/3161
+ ansible.builtin.shell:
+ executable: /bin/pwsh
+ cmd: |
+ $ProgressPreference = 'this | that'
+ changed_when: false
diff --git a/examples/playbooks/rule-role-name-path.yml b/examples/playbooks/rule-role-name-path.yml
new file mode 100644
index 0000000..5fedae8
--- /dev/null
+++ b/examples/playbooks/rule-role-name-path.yml
@@ -0,0 +1,10 @@
+---
+- name: Fixture for role-name[path] rule
+ hosts: localhost
+ roles:
+ - subfolder/1st_role # 1st
+ - role: subfolder/2nd_role # 2nd
+ tasks:
+ - name: Another
+ ansible.builtin.import_role:
+ name: subfolder/3rd_role # 3rd
diff --git a/examples/playbooks/rule-schema-become-method-fail.yml b/examples/playbooks/rule-schema-become-method-fail.yml
new file mode 100644
index 0000000..555e14e
--- /dev/null
+++ b/examples/playbooks/rule-schema-become-method-fail.yml
@@ -0,0 +1,10 @@
+---
+- name: Test 'become_method' plugin validity
+ hosts: localhost
+ become: true
+ become_method: this_is_not_an_installed_plugin
+ tasks:
+ - name: Another example
+ ansible.builtin.debug:
+ msg: "This should not be reached"
+ become_method: this_is_not_an_installed_plugin
diff --git a/examples/playbooks/rule-schema-become-method-pass.yml b/examples/playbooks/rule-schema-become-method-pass.yml
new file mode 100644
index 0000000..23eca31
--- /dev/null
+++ b/examples/playbooks/rule-schema-become-method-pass.yml
@@ -0,0 +1,5 @@
+---
+- name: Test 'become_method' plugin validity
+ hosts: localhost
+ become: true
+ become_method: ansible.builtin.sudo
diff --git a/examples/playbooks/rule-syntax-moves.yml b/examples/playbooks/rule-syntax-moves.yml
new file mode 100644
index 0000000..7cba53b
--- /dev/null
+++ b/examples/playbooks/rule-syntax-moves.yml
@@ -0,0 +1,16 @@
+---
+- name: Fixture for syntax[moves]
+ hosts: localhost
+ tasks:
+ - name: 1st
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_flattened: [] # moved to community.general in 2.10
+ - name: 2nd
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_cartesian: [] # moved to community.general in 2.10
+ - name: 3rd
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_filetree: [] # moved to community.general in 2.10
diff --git a/examples/playbooks/rule-validate-module-options-pass-2.yml b/examples/playbooks/rule-validate-module-options-pass-2.yml
new file mode 100644
index 0000000..90b88b3
--- /dev/null
+++ b/examples/playbooks/rule-validate-module-options-pass-2.yml
@@ -0,0 +1,10 @@
+---
+- name: Fixture to validate module options action pass scenarios
+ hosts: localhost
+ tasks:
+ - name: Copy a new "ntp.conf" file into place with backup
+ ansible.builtin.copy:
+ src: /mine/ntp.conf
+ dest: /etc/ntp.conf
+ backup: true
+ mode: "0600"
diff --git a/examples/playbooks/rule-var-naming-fail.yml b/examples/playbooks/rule-var-naming-fail.yml
new file mode 100644
index 0000000..888ed72
--- /dev/null
+++ b/examples/playbooks/rule-var-naming-fail.yml
@@ -0,0 +1,32 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ CamelCaseIsBad: false # invalid 1
+ this_is_valid: # valid because content is a dict, not a variable
+ CamelCase: ...
+ ALL_CAPS: ...
+ ALL_CAPS_ARE_BAD_TOO: ... # invalid 2
+ CamelCaseButErrorIgnored: true # noqa: var-naming
+
+ tasks:
+ - name: Foo
+ ansible.builtin.set_fact:
+ "{{ 'test_' }}var": "value" # noqa: var-naming[no-jinja]
+ - name: Bar
+ ansible.builtin.set_fact:
+ CamelCaseButErrorIgnored: true # noqa: var-naming
+ - name: Test in a block
+ vars:
+ BAD: false # invalid 3
+ MoreBad: ... # invalid 4
+ block:
+ - name: Foo
+ vars:
+ ALL_CAPS_ARE_BAD_TOO: "{{ MoreBad }}" # invalid 5
+ ansible.builtin.set_fact:
+ CamelCaseIsBad: "{{ BAD }}" # invalid 6
+ - name: Test on register
+ ansible.builtin.debug:
+ var: test_var
+ register: CamelCaseIsBad # invalid 7
diff --git a/examples/playbooks/rule-yaml-fail.yml b/examples/playbooks/rule-yaml-fail.yml
new file mode 100644
index 0000000..05fb572
--- /dev/null
+++ b/examples/playbooks/rule-yaml-fail.yml
@@ -0,0 +1,18 @@
+---
+- name: Fixture for yaml rule that should generate 3 errors
+ # https://github.com/ansible/ansible-lint/issues/3139
+ hosts: localhost
+ tasks:
+ - name: "1"
+ ansible.builtin.debug:
+ msg: yes
+
+ - name: "2"
+ ansible.builtin.debug:
+ msg: yes
+ tags:
+ - skip_ansible_lint # this has no effect for yamllint rule
+
+ - name: "3"
+ ansible.builtin.debug:
+ msg: yes
diff --git a/examples/playbooks/rule-yaml-pass.yml b/examples/playbooks/rule-yaml-pass.yml
new file mode 100644
index 0000000..497471a
--- /dev/null
+++ b/examples/playbooks/rule-yaml-pass.yml
@@ -0,0 +1,7 @@
+---
+# yamllint disable rule:truthy
+- name: Fixture for yaml rule testing ability to use disable comments
+ hosts: localhost
+ tasks: []
+ become: yes # <-- allowed only due to comment above
+# yamllint enable rule:truthy
diff --git a/examples/playbooks/rule_literal_compare_fail.yml b/examples/playbooks/rule_literal_compare_fail.yml
new file mode 100644
index 0000000..6448d70
--- /dev/null
+++ b/examples/playbooks/rule_literal_compare_fail.yml
@@ -0,0 +1,19 @@
+---
+- name: Fixture for literal-compare
+ hosts: localhost
+ tasks:
+ - name: Example task # <-- 1st
+ ansible.builtin.debug:
+ msg: test
+ when: my_var == True
+
+ - name: Example task # <-- 2nd
+ ansible.builtin.debug:
+ msg: test
+ when: my_var == false
+
+ - name: Another example task # <-- 3rd
+ ansible.builtin.debug:
+ msg: test
+ when:
+ - my_var == false
diff --git a/examples/playbooks/rule_literal_compare_pass.yml b/examples/playbooks/rule_literal_compare_pass.yml
new file mode 100644
index 0000000..56737cb
--- /dev/null
+++ b/examples/playbooks/rule_literal_compare_pass.yml
@@ -0,0 +1,25 @@
+---
+- name: Fixture for literal-compare
+ hosts: localhost
+ tasks:
+ - name: Example task
+ ansible.builtin.debug:
+ msg: test
+ when: my_var
+
+ - name: Another example task
+ ansible.builtin.debug:
+ msg: test
+ when:
+ - 1 + 1 == 2
+ - true
+
+ - name: Example task
+ ansible.builtin.debug:
+ msg: test
+ when: not my_var
+
+ - name: Example task
+ ansible.builtin.debug:
+ msg: test
+ when: my_var not None
diff --git a/examples/playbooks/rulebook.yml b/examples/playbooks/rulebook.yml
new file mode 100644
index 0000000..3eaf308
--- /dev/null
+++ b/examples/playbooks/rulebook.yml
@@ -0,0 +1,21 @@
+---
+# That file is not a valid playbook but it is a valid rulebook that was
+# mistakenly put under a playbook directory.
+- name: Demo rules with kafka as source
+ hosts: localhost
+ sources:
+ - name: kafka
+ kafka:
+ topic: eda
+ host: localhost
+ port: 9092
+ group_id: testing
+ rules:
+ - name:
+ condition: event.i is defined
+ action:
+ debug:
+ - name:
+ condition: event.stop == true
+ action:
+ shutdown:
diff --git a/examples/playbooks/run-once-fail.yml b/examples/playbooks/run-once-fail.yml
new file mode 100644
index 0000000..8963196
--- /dev/null
+++ b/examples/playbooks/run-once-fail.yml
@@ -0,0 +1,12 @@
+---
+- name: "Example with run_once"
+ hosts: all
+ # strategy: free # noqa: run-once[play] (Corrected code example)
+ strategy: free
+ gather_facts: false
+ tasks:
+ # - name: Task with run_once # noqa: run-once[task] (Corrected code example)
+ - name: Task with run_once
+ ansible.builtin.debug:
+ msg: "Test"
+ run_once: true # <-- avoid use of strategy as free at play level when using run_once at task level
diff --git a/examples/playbooks/run-once-pass.yml b/examples/playbooks/run-once-pass.yml
new file mode 100644
index 0000000..030a2a0
--- /dev/null
+++ b/examples/playbooks/run-once-pass.yml
@@ -0,0 +1,8 @@
+---
+- name: "Example without run_once"
+ hosts: all
+ gather_facts: false
+ tasks:
+ - name: Task without run_once
+ ansible.builtin.debug:
+ msg: "Test"
diff --git a/examples/playbooks/schema-error-string.yml b/examples/playbooks/schema-error-string.yml
new file mode 100644
index 0000000..00e5e40
--- /dev/null
+++ b/examples/playbooks/schema-error-string.yml
@@ -0,0 +1,4 @@
+---
+foo
+# This file is valid YAML but from our point of view is an error, as is
+# neither a Sequence or a Mapping.
diff --git a/examples/playbooks/skiptasks.yml b/examples/playbooks/skiptasks.yml
new file mode 100644
index 0000000..e105ed3
--- /dev/null
+++ b/examples/playbooks/skiptasks.yml
@@ -0,0 +1,64 @@
+---
+- hosts: all
+
+ tasks:
+ - name: Test latest[git]
+ action: ansible.builtin.git
+
+ - name: Test latest[hg]
+ action: ansible.builtin.hg
+
+ - name: Test command-instead-of-module
+ ansible.builtin.command: git log
+ changed_when: false
+
+ - name: Test no-free-form
+ ansible.builtin.command: creates=B chmod 644 A
+
+ - name: Test latest[git] (skip)
+ action: ansible.builtin.git
+ tags:
+ - skip_ansible_lint
+
+ - name: Test latest[hg] (skip)
+ action: ansible.builtin.hg
+ tags:
+ - skip_ansible_lint
+
+ - name: Test command-instead-of-module (skip)
+ ansible.builtin.command: git log
+ tags:
+ - skip_ansible_lint
+
+ - name: Test no-free-form (skip)
+ ansible.builtin.command: chmod 644 A
+ tags:
+ - skip_ansible_lint
+
+ - name: Test latest[git] (don't warn)
+ ansible.builtin.command: git log
+ args:
+ warn: false
+ changed_when: false
+
+ - name: Test latest[hg] (don't warn)
+ ansible.builtin.command: chmod 644 A
+ args:
+ warn: false
+ creates: B
+
+ - name: Test latest[hg] (warn)
+ ansible.builtin.command: chmod 644 A
+ args:
+ warn: true
+ creates: B
+
+ - name: Test latest[git] (don't warn single line)
+ ansible.builtin.command: warn=False chdir=/tmp/blah git log
+ changed_when: false
+
+ - name: Test latest[hg] (don't warn single line)
+ ansible.builtin.command: warn=no creates=B chmod 644 A
+
+ - name: Test latest[hg] (warn single line)
+ ansible.builtin.command: warn=yes creates=B chmod 644 A
diff --git a/examples/playbooks/strict-mode.yml b/examples/playbooks/strict-mode.yml
new file mode 100644
index 0000000..a69c428
--- /dev/null
+++ b/examples/playbooks/strict-mode.yml
@@ -0,0 +1,8 @@
+---
+- name: Fixture for test_strict
+ hosts: localhost
+ tasks:
+ - name: Display debug information
+ ansible.builtin.stat:
+ path2: echo "Hello World" # <-- args[module] due to invalid use of path2 instead of path
+ changed_when: false
diff --git a/examples/playbooks/syntax-error-string.yml b/examples/playbooks/syntax-error-string.yml
new file mode 100644
index 0000000..e158ea8
--- /dev/null
+++ b/examples/playbooks/syntax-error-string.yml
@@ -0,0 +1,7 @@
+# This file is valid YAML and passed JSON Schema validation but not ansible
+# own syntax check.
+
+- hosts: localhost
+ tasks:
+ - name: Invalid syntax
+ x.y.z.w: {}
diff --git a/examples/playbooks/syntax-error.yml b/examples/playbooks/syntax-error.yml
new file mode 100644
index 0000000..8657633
--- /dev/null
+++ b/examples/playbooks/syntax-error.yml
@@ -0,0 +1,6 @@
+---
+- name: This should raise syntax-error
+ hosts: localhost
+ tasks:
+ ansible.builtin.debug:
+ msg: Note that `tasks` is not entered as a list.
diff --git a/examples/playbooks/task_in_list-0.yml b/examples/playbooks/task_in_list-0.yml
new file mode 100644
index 0000000..7956dbb
--- /dev/null
+++ b/examples/playbooks/task_in_list-0.yml
@@ -0,0 +1,28 @@
+---
+- name: Fixture for task_in_list
+ hosts: localhost
+ tasks:
+ - name: A
+ ansible.builtin.debug:
+ msg: "A"
+ - name: B
+ ansible.builtin.debug:
+ msg: "C"
+ pre_tasks:
+ - name: C
+ ansible.builtin.debug:
+ msg: "C"
+ post_tasks:
+ - name: D
+ block:
+ - name: E
+ ansible.builtin.debug:
+ msg: "E"
+ rescue:
+ - name: F
+ ansible.builtin.debug:
+ msg: "F"
+ always:
+ - name: G
+ ansible.builtin.debug:
+ msg: "G"
diff --git a/examples/playbooks/taskimports.yml b/examples/playbooks/taskimports.yml
new file mode 100644
index 0000000..4e5b5f1
--- /dev/null
+++ b/examples/playbooks/taskimports.yml
@@ -0,0 +1,16 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ varset: tasks/simple_task.yml
+ tasks:
+ - name: Import 1 # noqa: fqcn
+ import_tasks: tasks/nestedincludes.yml
+ # - import_tasks: "{{ varnotset }}.yml"
+ - name: Import 2 # noqa: fqcn
+ import_tasks: "{{ varset }}"
+ - name: Import 3 # noqa: fqcn
+ import_tasks: tasks/directory with spaces/main.yml
+ # Import tasks by FQCN as well to ensure they load
+ - name: Import 4
+ ansible.builtin.import_tasks: tasks/passing_task.yml
diff --git a/examples/playbooks/taskincludes.yml b/examples/playbooks/taskincludes.yml
new file mode 100644
index 0000000..91f0fc6
--- /dev/null
+++ b/examples/playbooks/taskincludes.yml
@@ -0,0 +1,11 @@
+---
+- name: Fixture
+ hosts: localhost
+ vars:
+ varset: tasks/simple_task.yml
+ tasks:
+ # - include_tasks: "{{ varnotset }}.yml"
+ - include_tasks: "{{ varset }}.yml"
+ - include_tasks: tasks/directory with spaces/main.yml
+ # Include tasks by FQCN as well to ensure they load
+ - ansible.builtin.include_tasks: tasks/passing_task.yml
diff --git a/examples/playbooks/tasks/bug-2875.yml b/examples/playbooks/tasks/bug-2875.yml
new file mode 100644
index 0000000..73abe23
--- /dev/null
+++ b/examples/playbooks/tasks/bug-2875.yml
@@ -0,0 +1,9 @@
+---
+- name: "Reproduce bug #2875"
+ include_tasks: "{{ lookup('first_found', __ff_params) }}"
+ vars:
+ __ff_params:
+ files:
+ - "default.yml"
+ paths:
+ - "{{ role_path }}/tasks/setup"
diff --git a/examples/playbooks/tasks/conflicting-action-statements.yml b/examples/playbooks/tasks/conflicting-action-statements.yml
new file mode 100644
index 0000000..3fe4d71
--- /dev/null
+++ b/examples/playbooks/tasks/conflicting-action-statements.yml
@@ -0,0 +1,3 @@
+---
+- shell: pip
+ changed: false
diff --git a/examples/playbooks/tasks/directory with spaces/main.yml b/examples/playbooks/tasks/directory with spaces/main.yml
new file mode 100644
index 0000000..d7c5c1c
--- /dev/null
+++ b/examples/playbooks/tasks/directory with spaces/main.yml
@@ -0,0 +1,4 @@
+---
+# this should generate: name[missing]: All tasks should be named
+- ansible.builtin.assert:
+ fail_msg: tasks in directory with spaces included
diff --git a/examples/playbooks/tasks/empty_blocks.yml b/examples/playbooks/tasks/empty_blocks.yml
new file mode 100644
index 0000000..2555e35
--- /dev/null
+++ b/examples/playbooks/tasks/empty_blocks.yml
@@ -0,0 +1,17 @@
+---
+- name: A named block task
+ block:
+ - name: an assertion
+ ansible.builtin.assert:
+ fail_msg: foo
+ rescue: # null
+ always: {}
+- block:
+ - name: Another assertion
+ ansible.builtin.assert:
+ fail_msg: bar
+ rescue: {}
+ always:
+ - name: Yet another assertion
+ ansible.builtin.assert:
+ fail_msg: baz
diff --git a/examples/playbooks/tasks/include-in-block-inner.yml b/examples/playbooks/tasks/include-in-block-inner.yml
new file mode 100644
index 0000000..bc6f81b
--- /dev/null
+++ b/examples/playbooks/tasks/include-in-block-inner.yml
@@ -0,0 +1,5 @@
+---
+- name: include-in-block-inner | I am a block
+ block:
+ - name: simple_task | Include tasks from inside a block
+ ansible.builtin.include_tasks: simple_task.yml
diff --git a/examples/playbooks/tasks/included-task-with-vars.yml b/examples/playbooks/tasks/included-task-with-vars.yml
new file mode 100644
index 0000000..6cf7a88
--- /dev/null
+++ b/examples/playbooks/tasks/included-task-with-vars.yml
@@ -0,0 +1,4 @@
+---
+- name: included-task-with-vars | Test
+ ansible.builtin.debug:
+ msg: "{{ foo }}"
diff --git a/examples/playbooks/tasks/included-with-lint.yml b/examples/playbooks/tasks/included-with-lint.yml
new file mode 100644
index 0000000..0f2bbd2
--- /dev/null
+++ b/examples/playbooks/tasks/included-with-lint.yml
@@ -0,0 +1,4 @@
+---
+# missing a task name
+- ansible.builtin.assert:
+ fail_msg: foo
diff --git a/examples/playbooks/tasks/malformed.yml b/examples/playbooks/tasks/malformed.yml
new file mode 100644
index 0000000..f0805cd
--- /dev/null
+++ b/examples/playbooks/tasks/malformed.yml
@@ -0,0 +1,3 @@
+---
+# should produce a malformed error from ansible syntax check
+- oops this is invalid
diff --git a/examples/playbooks/tasks/nestedincludes.yml b/examples/playbooks/tasks/nestedincludes.yml
new file mode 100644
index 0000000..6c2631f
--- /dev/null
+++ b/examples/playbooks/tasks/nestedincludes.yml
@@ -0,0 +1,3 @@
+---
+- name: simple_task | One include
+ include_tasks: tasks/simple_task.yml
diff --git a/examples/playbooks/tasks/passing_task.yml b/examples/playbooks/tasks/passing_task.yml
new file mode 100644
index 0000000..23a8651
--- /dev/null
+++ b/examples/playbooks/tasks/passing_task.yml
@@ -0,0 +1,4 @@
+---
+- name: passing_task | Simple task to include which generates no errors
+ ansible.builtin.assert:
+ that: true
diff --git a/examples/playbooks/tasks/rule-name-prefix-fail.yml b/examples/playbooks/tasks/rule-name-prefix-fail.yml
new file mode 100644
index 0000000..680ccd1
--- /dev/null
+++ b/examples/playbooks/tasks/rule-name-prefix-fail.yml
@@ -0,0 +1,13 @@
+---
+- name: rule-name-prefix-fail | this is not correctly capitalized
+ ansible.builtin.assert:
+ that: true
+- name: This is missing the prefix
+ ansible.builtin.assert:
+ that: true
+- name: name | This prefix is incomplete
+ ansible.builtin.assert:
+ that: true
+- name: rule-name-prefix-fail | This is correctly | named too
+ ansible.builtin.assert:
+ that: true
diff --git a/examples/playbooks/tasks/simple_task.yml b/examples/playbooks/tasks/simple_task.yml
new file mode 100644
index 0000000..aea6938
--- /dev/null
+++ b/examples/playbooks/tasks/simple_task.yml
@@ -0,0 +1,4 @@
+---
+- name: simple_task | This is named
+ ansible.builtin.assert:
+ fail_msg: foo
diff --git a/examples/playbooks/tasks/vars/bug-3289.yml b/examples/playbooks/tasks/vars/bug-3289.yml
new file mode 100644
index 0000000..01308f2
--- /dev/null
+++ b/examples/playbooks/tasks/vars/bug-3289.yml
@@ -0,0 +1,2 @@
+---
+city: Dresden
diff --git a/examples/playbooks/tasks/varset.yml b/examples/playbooks/tasks/varset.yml
new file mode 100644
index 0000000..f4337eb
--- /dev/null
+++ b/examples/playbooks/tasks/varset.yml
@@ -0,0 +1,4 @@
+---
+- debug: msg="var was set"
+
+- git: repo=hello.git
diff --git a/examples/playbooks/tasks/varunset.yml b/examples/playbooks/tasks/varunset.yml
new file mode 100644
index 0000000..a5508f0
--- /dev/null
+++ b/examples/playbooks/tasks/varunset.yml
@@ -0,0 +1,2 @@
+---
+- debug: msg="var was not set"
diff --git a/examples/playbooks/tasks/x.yml b/examples/playbooks/tasks/x.yml
new file mode 100644
index 0000000..a98230f
--- /dev/null
+++ b/examples/playbooks/tasks/x.yml
@@ -0,0 +1,7 @@
+---
+- # nothing, checks bug #849
+- name: Test include
+ action: funny value=clown
+ args:
+ key: value
+- # a second null task, validates yaml_utils.get_path_to_task
diff --git a/examples/playbooks/templates/not-valid.yaml b/examples/playbooks/templates/not-valid.yaml
new file mode 100644
index 0000000..5d34f55
--- /dev/null
+++ b/examples/playbooks/templates/not-valid.yaml
@@ -0,0 +1,2 @@
+# Used to validate that a templated YAML file does not confuse the linter
+{% include 'port.j2' %}
diff --git a/examples/playbooks/test_import_with_conflicting_action_statements.yml b/examples/playbooks/test_import_with_conflicting_action_statements.yml
new file mode 100644
index 0000000..042a8dd
--- /dev/null
+++ b/examples/playbooks/test_import_with_conflicting_action_statements.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+ tasks:
+ - import_tasks: tasks/conflicting-action-statements.yml
diff --git a/examples/playbooks/test_import_with_malformed.yml b/examples/playbooks/test_import_with_malformed.yml
new file mode 100644
index 0000000..6ce21cd
--- /dev/null
+++ b/examples/playbooks/test_import_with_malformed.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+ tasks:
+ - import_tasks: tasks/malformed.yml
diff --git a/examples/playbooks/test_include_inplace.yml b/examples/playbooks/test_include_inplace.yml
new file mode 100644
index 0000000..0f4cf2c
--- /dev/null
+++ b/examples/playbooks/test_include_inplace.yml
@@ -0,0 +1,5 @@
+---
+- name: Test fixture
+ hosts: all
+ roles:
+ - include_in_the_place
diff --git a/examples/playbooks/test_include_relative.yml b/examples/playbooks/test_include_relative.yml
new file mode 100644
index 0000000..340d949
--- /dev/null
+++ b/examples/playbooks/test_include_relative.yml
@@ -0,0 +1,6 @@
+---
+- name: Test fixture
+ hosts: localhost
+ gather_facts: false
+ roles:
+ - include_relative
diff --git a/examples/playbooks/test_skip_inside_yaml.yml b/examples/playbooks/test_skip_inside_yaml.yml
new file mode 100644
index 0000000..1f72954
--- /dev/null
+++ b/examples/playbooks/test_skip_inside_yaml.yml
@@ -0,0 +1,64 @@
+---
+- name: Fixture
+ hosts: all
+ tags:
+ - skip_ansible_lint # should disable error at playbook level
+ tasks:
+ - name: Test
+ action: community.general.hg
+ args:
+ repo: foo
+ version: HEAD
+
+ - name: Test latest[hg] (skipped)
+ action: community.general.hg
+ args:
+ repo: foo
+ # revision: HEAD
+
+ - name: Test latest[git] and partial-become # noqa: latest[git]
+ action: ansible.builtin.git
+ args:
+ repo: foo
+ version: HEAD
+ become_user: alice
+
+ - name: Test latest[git] and partial-become (skipped) # noqa: latest[git] partial-become
+ action: ansible.builtin.git
+ args:
+ repo: foo
+ version: HEAD
+ become_user: alice
+
+ - name: Test YAML # <-- 1 jinja[spacing]
+ ansible.builtin.get_url:
+ # noqa: risky-file-permissions
+ url: http://example.com/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/file.conf # <-- 2 yaml[line-length]
+ dest: "{{dest_proj_path}}/foo.conf"
+ - name: Test YAML and jinja[spacing] (skipped)
+ ansible.builtin.get_url:
+ # noqa: risky-file-permissions
+ url: http://example.com/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/really_long_path/file.conf # noqa: yaml[line-length]
+ dest: "{{dest_proj_path}}/foo.conf" # noqa: jinja[spacing]
+
+ - name: Test no-free-form # <-- 3 no-free-form
+ ansible.builtin.command: creates=B chmod 644 A # noqa: no-free-form
+ - name: Test no-free-form # <-- 4 no-free-form
+ ansible.builtin.command: warn=yes creates=B chmod 644 A # noqa: no-free-form
+ - name: Test no-free-form (skipped via no warn)
+ ansible.builtin.command: warn=no creates=B chmod 644 A # noqa: no-free-form
+ - name: Test no-free-form (skipped via skip_ansible_lint)
+ ansible.builtin.command: creates=B chmod 644 A # noqa: no-free-form
+ tags:
+ - skip_ansible_lint
+
+- name: Fixture 2
+ hosts: localhost
+ tasks:
+ - name: Foo
+ become: true
+ block:
+ - name: Bar
+ become_user: john_doe
+ ansible.builtin.command: "/etc/test.sh"
+ changed_when: false
diff --git a/examples/playbooks/unicode.transformed.yml b/examples/playbooks/unicode.transformed.yml
new file mode 100644
index 0000000..c07e9e7
--- /dev/null
+++ b/examples/playbooks/unicode.transformed.yml
@@ -0,0 +1,8 @@
+---
+- name: Fixture
+ hosts: all
+ tasks:
+ # cspell:disable-next-line
+ - name: Some теÑÑ‚
+ ansible.builtin.command:
+ cmd: uname
diff --git a/examples/playbooks/unicode.yml b/examples/playbooks/unicode.yml
new file mode 100644
index 0000000..c07e9e7
--- /dev/null
+++ b/examples/playbooks/unicode.yml
@@ -0,0 +1,8 @@
+---
+- name: Fixture
+ hosts: all
+ tasks:
+ # cspell:disable-next-line
+ - name: Some теÑÑ‚
+ ansible.builtin.command:
+ cmd: uname
diff --git a/examples/playbooks/valid.yml b/examples/playbooks/valid.yml
new file mode 100644
index 0000000..3c67f66
--- /dev/null
+++ b/examples/playbooks/valid.yml
@@ -0,0 +1,4 @@
+---
+- name: Minimal test play
+ hosts: localhost
+ tasks: []
diff --git a/examples/playbooks/valid_with_alt_extension.yaml b/examples/playbooks/valid_with_alt_extension.yaml
new file mode 100644
index 0000000..e3694c8
--- /dev/null
+++ b/examples/playbooks/valid_with_alt_extension.yaml
@@ -0,0 +1,7 @@
+---
+# Used to validate that we also accept .yaml extension on playbooks
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - ansible.builtin.debug: # <-- should notify about missing 'name'
+ msg: hello!
diff --git a/examples/playbooks/vars/empty.transformed.yml b/examples/playbooks/vars/empty.transformed.yml
new file mode 100644
index 0000000..10abfa5
--- /dev/null
+++ b/examples/playbooks/vars/empty.transformed.yml
@@ -0,0 +1,3 @@
+
+---
+# broken vars files due to spacing at the start of the file.
diff --git a/examples/playbooks/vars/empty.yml b/examples/playbooks/vars/empty.yml
new file mode 100644
index 0000000..10abfa5
--- /dev/null
+++ b/examples/playbooks/vars/empty.yml
@@ -0,0 +1,3 @@
+
+---
+# broken vars files due to spacing at the start of the file.
diff --git a/examples/playbooks/vars/empty_vars.transformed.yml b/examples/playbooks/vars/empty_vars.transformed.yml
new file mode 100644
index 0000000..a6e18c1
--- /dev/null
+++ b/examples/playbooks/vars/empty_vars.transformed.yml
@@ -0,0 +1,2 @@
+---
+# Make sure that the Transformer does not mangle comment-only files!
diff --git a/examples/playbooks/vars/empty_vars.yml b/examples/playbooks/vars/empty_vars.yml
new file mode 100644
index 0000000..a6e18c1
--- /dev/null
+++ b/examples/playbooks/vars/empty_vars.yml
@@ -0,0 +1,2 @@
+---
+# Make sure that the Transformer does not mangle comment-only files!
diff --git a/examples/playbooks/vars/invalid_vars_schema.yml b/examples/playbooks/vars/invalid_vars_schema.yml
new file mode 100644
index 0000000..d4142a2
--- /dev/null
+++ b/examples/playbooks/vars/invalid_vars_schema.yml
@@ -0,0 +1,2 @@
+---
+123: true # invalid as schema expects string key
diff --git a/examples/playbooks/vars/jinja-spacing.yml b/examples/playbooks/vars/jinja-spacing.yml
new file mode 100644
index 0000000..419c7bc
--- /dev/null
+++ b/examples/playbooks/vars/jinja-spacing.yml
@@ -0,0 +1,41 @@
+---
+# Should raise jinja[spacing] at line [14, 15, 16, 17, 18, 19, 22, 32, 38], at following variables.
+# ".bad_var_1", ".bad_var_2", ".bad_var_3", ".invalid_multiline_nested_json", ".invalid_nested_json"
+good_var_1: "{{ good_format }}"
+good_var_2: "Value: {{ good_format }}"
+good_var_3: "{{ good_format | filter }}"
+good_var_4: "Value: {{ good_format | filter }}"
+jinja_escape_1: "{{ '{{' }}"
+jinja_escape_2: docker info --format '{{ '{{' }}json .Swarm.LocalNodeState{{ '}}' }}' | tr -d '"'
+jinja_whitespace_control: |
+ {{ good_format }}/
+ {{- good_format }}
+ {{- good_format -}}
+bad_var_1: "{{bad_format}}" # <-- 1
+bad_var_2: "Value: {{ bad_format}}" # <-- 2
+bad_var_3: "{{bad_format }}" # <-- 3
+bad_var_4: "{{ bad_format|filter }}" # <-- 4
+bad_var_5: "Value: {{ bad_format |filter }}" # <-- 5
+bad_var_6: "{{ bad_format| filter }}" # <-- 6
+# spell-checker: disable-next-line
+non_jinja_var: "data = ${lookup{$local_part}lsearch{/etc/aliases}}" # noqa: jinja[spacing]
+json_inside_jinja: "{{ {'test': {'subtest': variable}} }}"
+multiline_vars: # Assert that no false positive on multiline exists
+ cases:
+ case1: >-
+ http://example.com/{{
+ case1 }}
+ case2: >-
+ http://example.com/{{
+ case2 }}
+valid_nested_json: "{{ {'dummy_2': {'nested_dummy_1': 'value_1', 'nested_dummy_2': value_2}} | combine(dummy_1) }}"
+invalid_nested_json: "{{ {'dummy_2': {'nested_dummy_1': 'value_1', 'nested_dummy_2': value_2}} | combine(dummy_1)}}" # <-- 7
+
+valid_multiline_nested_json: >-
+ {{ {'dummy_2': {'nested_dummy_1': value_1,
+ 'nested_dummy_2': value_2}} |
+ combine(dummy_1) }}
+invalid_multiline_nested_json: >- # ignored multiline expression, for now
+ {{ {'dummy_2': {'nested_dummy_1': value_1,
+ 'nested_dummy_2': value_2}} |
+ combine(dummy_1)}}
diff --git a/examples/playbooks/vars/other.yml b/examples/playbooks/vars/other.yml
new file mode 100644
index 0000000..2771218
--- /dev/null
+++ b/examples/playbooks/vars/other.yml
@@ -0,0 +1,2 @@
+---
+some_var: some_value_defined_in_vars_other
diff --git a/examples/playbooks/vars/rule_jinja_vars.yml b/examples/playbooks/vars/rule_jinja_vars.yml
new file mode 100644
index 0000000..da9e6d1
--- /dev/null
+++ b/examples/playbooks/vars/rule_jinja_vars.yml
@@ -0,0 +1,5 @@
+# this should not trigger any errors because a 'when' inside
+# a vars files, does not use implicit jinja.
+---
+foo:
+ when: "{{ var }}"
diff --git a/examples/playbooks/vars/rule_var_naming_fail.yml b/examples/playbooks/vars/rule_var_naming_fail.yml
new file mode 100644
index 0000000..3870c26
--- /dev/null
+++ b/examples/playbooks/vars/rule_var_naming_fail.yml
@@ -0,0 +1,14 @@
+---
+CamelCaseIsBad: false # invalid
+this_is_valid: # valid because content is a dict, not a variable
+ CamelCase: ...
+ ALL_CAPS: ...
+ALL_CAPS_ARE_BAD_TOO: ... # invalid
+"{{ 'test_' }}var": "value" # noqa: schema
+CamelCaseButErrorIgnored: true # noqa: var-naming
+assert: true # invalid due to being Python reserved keyword
+é: true # invalid due to non-ascii character
+hosts: true # invalid as being Ansible reserved name
+role_name: boo # invalid as being Ansible special magic variable
+ansible_facts: {} # special variable that we allow to be written
+ansible_python_interpreter: python3 # special variable that we allow to be written
diff --git a/examples/playbooks/vars/strings.transformed.yml b/examples/playbooks/vars/strings.transformed.yml
new file mode 100644
index 0000000..6f2aae1
--- /dev/null
+++ b/examples/playbooks/vars/strings.transformed.yml
@@ -0,0 +1,39 @@
+---
+# Make sure that the Transformer does not mangle strings
+# TODO: there is a bug in ruamel.yaml that discards some EOL comments
+
+single: single # this is a comment
+single_with_double: '"single" quoted' # this is a comment
+
+single_multiline_with_octothorpe: "single over 160 char line to force wrapping. over 160 char line to force wrapping. over 160 char line to force wrapping. over 160\n
+ # this is not a comment"
+
+double: double # this is a comment
+double_with_single: "'double' quoted" # this is a comment
+
+double_multiline_with_octothorpe: "double over 160 char line to force wrapping. over 160 char line to force wrapping. over 160 char line to force wrapping. over 160\n
+ # this is not a comment"
+
+# this is a comment
+folded_block_scalar_with_octothorpe: > # comment 1
+ # this is not a comment
+
+# this is a comment
+folded_chomp_strip_block_scalar_with_octothorpe: >- # comment 2
+ # this is not a comment
+
+# this is a comment
+folded_chomp_keep_block_scalar_with_octothorpe: >+ # comment 3
+ # this is not a comment
+
+# this is a comment
+literal_block_scalar_with_octothorpe: | # this is a | EOL comment
+ # this is not a comment
+
+# this is a comment
+literal_chomp_strip_block_scalar_with_octothorpe: |- # this is a | EOL comment
+ # this is not a comment
+
+# this is a comment
+literal_chomp_keep_block_scalar_with_octothorpe: | # this is a | EOL comment
+ # this is not a comment
diff --git a/examples/playbooks/vars/strings.yml b/examples/playbooks/vars/strings.yml
new file mode 100644
index 0000000..a1b7868
--- /dev/null
+++ b/examples/playbooks/vars/strings.yml
@@ -0,0 +1,45 @@
+---
+# Make sure that the Transformer does not mangle strings
+# TODO: there is a bug in ruamel.yaml that discards some EOL comments
+
+single: "single" # this is a comment
+single_with_double: '"single" quoted' # this is a comment
+
+single_multiline_with_octothorpe: # this EOL comment gets lost
+ "single over 160 char line to force wrapping. over 160 char line to force wrapping. over 160 char line to force wrapping.
+ over 160
+
+ # this is not a comment"
+
+double: "double" # this is a comment
+double_with_single: "'double' quoted" # this is a comment
+
+double_multiline_with_octothorpe: # this EOL comment gets lost
+ "double over 160 char line to force wrapping. over 160 char line to force wrapping. over 160 char line to force wrapping.
+ over 160
+
+ # this is not a comment"
+
+# this is a comment
+folded_block_scalar_with_octothorpe: > # comment 1
+ # this is not a comment
+
+# this is a comment
+folded_chomp_strip_block_scalar_with_octothorpe: >- # comment 2
+ # this is not a comment
+
+# this is a comment
+folded_chomp_keep_block_scalar_with_octothorpe: >+ # comment 3
+ # this is not a comment
+
+# this is a comment
+literal_block_scalar_with_octothorpe: | # this is a | EOL comment
+ # this is not a comment
+
+# this is a comment
+literal_chomp_strip_block_scalar_with_octothorpe: |- # this is a | EOL comment
+ # this is not a comment
+
+# this is a comment
+literal_chomp_keep_block_scalar_with_octothorpe: |+ # this is a | EOL comment
+ # this is not a comment
diff --git a/examples/playbooks/vars/subfolder/settings.yml b/examples/playbooks/vars/subfolder/settings.yml
new file mode 100644
index 0000000..1c84d58
--- /dev/null
+++ b/examples/playbooks/vars/subfolder/settings.yml
@@ -0,0 +1,2 @@
+---
+some_var: some_value_defined_in_vars_subfolder_settings
diff --git a/examples/playbooks/vars/vault_full.yml b/examples/playbooks/vars/vault_full.yml
new file mode 100644
index 0000000..c432c62
--- /dev/null
+++ b/examples/playbooks/vars/vault_full.yml
@@ -0,0 +1,11 @@
+---
+$ANSIBLE_VAULT;1.1;AES256
+35366433323361393130396530643233373262666636646439303032366431303363316232313738
+3738636130636431623936303932306430316635663136610a353737333966353462333532393631
+36613030643762636138613734313862333165346464626461313361353732336131633137653865
+3862386136386137650a303433643531613337393735633338383163353737656339653134346363
+63613436333937313738633437373566333065663662643664643261313366323236356364316663
+62336264666464323066336365616634626336616537646336656266343562336533343732613539
+61643661303566313664313164623731316236666235656337363632393665353536303730666532
+64666639306361653963363462393966623763626566613831613739333666333665343734333630
+63623730623033346163393834396639383234393637653733396466316132663131
diff --git a/examples/playbooks/vars/vault_partial.yml b/examples/playbooks/vars/vault_partial.yml
new file mode 100644
index 0000000..9806786
--- /dev/null
+++ b/examples/playbooks/vars/vault_partial.yml
@@ -0,0 +1,8 @@
+---
+ldap_password: !vault |
+ $ANSIBLE_VAULT;1.1;AES256
+ 35323062386261383633623963303361313937653837333033613933623434343138663331336164
+ 3534373564393166656664306537633035613962356662645a316562353832363736313935383665
+ 33306432623765646338303236363061326538653163643466643446716164326364643937623365
+ 6239383765373639390a646361343566353934633532376231653838386231653865386665303733
+ 34336534613538326639306139363538306636383463663437643466653064646363
diff --git a/examples/playbooks/warning-from-module.yml b/examples/playbooks/warning-from-module.yml
new file mode 100644
index 0000000..d515361
--- /dev/null
+++ b/examples/playbooks/warning-from-module.yml
@@ -0,0 +1,11 @@
+---
+# https://github.com/ansible/ansible-lint/issues/3216
+- name: "Reproduce for bug #3216 warning from core module using Display.warning()"
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Some task
+ ansible.builtin.debug:
+ msg: "{{ qq | unique }}"
+ vars:
+ qq: ["qq", "ww"]
diff --git a/examples/playbooks/with-skip-tag-id.yml b/examples/playbooks/with-skip-tag-id.yml
new file mode 100644
index 0000000..b383617
--- /dev/null
+++ b/examples/playbooks/with-skip-tag-id.yml
@@ -0,0 +1,7 @@
+---
+- hosts: all
+ tasks:
+ - name: Trailing whitespace on this line
+ ansible.builtin.git:
+ repo: "{{ archive_services_repo_url }}"
+ dest: /home/www
diff --git a/examples/playbooks/with-umlaut-ä.yml b/examples/playbooks/with-umlaut-ä.yml
new file mode 100644
index 0000000..2ee7a83
--- /dev/null
+++ b/examples/playbooks/with-umlaut-ä.yml
@@ -0,0 +1,5 @@
+---
+- hosts:
+ - localhost
+ roles:
+ - name: node
diff --git a/examples/reqs_v1/requirements.yml b/examples/reqs_v1/requirements.yml
new file mode 100644
index 0000000..65643ae
--- /dev/null
+++ b/examples/reqs_v1/requirements.yml
@@ -0,0 +1,10 @@
+---
+# v1 requirements test file
+
+# As Jeff never created releases on hit repo, we are unable to download tar.gz
+# archives, so we need to use the slower git cloning instead.
+# - src: https://github.com/geerlingguy/mysql/archive/refs/tags/4.2.0.tar.gz
+
+- name: geerlingguy.mysql
+ src: https://github.com/geerlingguy/ansible-role-mysql
+ version: 4.2.0
diff --git a/examples/reqs_v2/requirements.yml b/examples/reqs_v2/requirements.yml
new file mode 100644
index 0000000..735bf3c
--- /dev/null
+++ b/examples/reqs_v2/requirements.yml
@@ -0,0 +1,8 @@
+---
+roles:
+ - name: geerlingguy.mysql
+ src: https://github.com/geerlingguy/ansible-role-mysql
+ version: 4.2.0
+
+collections:
+ - name: https://galaxy.ansible.com/download/community-molecule-0.1.0.tar.gz
diff --git a/examples/roles/ansible-role-foo/tasks/main.yaml b/examples/roles/ansible-role-foo/tasks/main.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/ansible-role-foo/tasks/main.yaml
diff --git a/examples/roles/bobbins/tasks/imported_tasks.yml b/examples/roles/bobbins/tasks/imported_tasks.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/bobbins/tasks/imported_tasks.yml
diff --git a/examples/roles/bobbins/tasks/main.yml b/examples/roles/bobbins/tasks/main.yml
new file mode 100644
index 0000000..992c85c
--- /dev/null
+++ b/examples/roles/bobbins/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+- name: Test tasks
+ action: git a=b c=d
+
+- name: Import tasks
+ ansible.builtin.import_tasks:
+ file: imported_tasks.yml
diff --git a/examples/roles/broken_argument_specs/meta/argument_specs.yml b/examples/roles/broken_argument_specs/meta/argument_specs.yml
new file mode 100644
index 0000000..ddc9862
--- /dev/null
+++ b/examples/roles/broken_argument_specs/meta/argument_specs.yml
@@ -0,0 +1,5 @@
+---
+argument_specs:
+ main:
+ foo: bar # <-- invalid based on json schema
+ options: {}
diff --git a/examples/roles/dependency_in_meta/meta/main.yml b/examples/roles/dependency_in_meta/meta/main.yml
new file mode 100644
index 0000000..ce20d01
--- /dev/null
+++ b/examples/roles/dependency_in_meta/meta/main.yml
@@ -0,0 +1,42 @@
+---
+# meta file, determined by ending in meta/main.yml
+# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#role-dependencies
+allow_duplicates: true
+dependencies:
+ # from Bitbucket
+ - src: git+http://bitbucket.org/willthames/git-ansible-galaxy
+ version: v1.4
+
+ # from Bitbucket, alternative syntax and caveats
+ - src: http://bitbucket.org/willthames/hg-ansible-galaxy
+ scm: hg
+
+ # from galaxy
+ - src: yatesr.timezone
+
+ # from GitHub
+ - src: https://github.com/bennojoy/nginx
+
+ # from GitHub, overriding the name and specifying a specific tag
+ - src: https://github.com/bennojoy/nginx
+ version: master
+ name: nginx_role
+
+ # from GitLab or other git-based scm
+ - src: git@gitlab.company.com:my-group/my-repo.git
+ scm: git
+ version: "0.1" # quoted, so YAML doesn't parse this as a floating-point value
+
+ # from a webserver, where the role is packaged in a tar.gz
+ - src: https://some.webserver.example.com/files/master.tar.gz
+ name: http-role
+
+galaxy_info:
+ standalone: true
+ author: foo
+ description: Testing meta
+ company: Not applicable
+ license: MIT
+ min_ansible_version: "2.5"
+ platforms:
+ - name: Fedora
diff --git a/examples/roles/fixture_1/tasks/main.yml b/examples/roles/fixture_1/tasks/main.yml
new file mode 100644
index 0000000..8e1706c
--- /dev/null
+++ b/examples/roles/fixture_1/tasks/main.yml
@@ -0,0 +1,21 @@
+---
+- name: Bad git 1 # noqa: latest[git]
+ action: ansible.builtin.git repo=. clone=no
+- name: Bad git 2 <-- 1st
+ action: ansible.builtin.git repo=. clone=no
+- name: Block with rescue and always section
+ block:
+ - name: Bad git 3 # noqa: latest[git]
+ action: ansible.builtin.git repo=. clone=no
+ - name: Bad git 4 <-- 2nd
+ action: ansible.builtin.git repo=. clone=no
+ rescue:
+ - name: Bad git 5 # noqa: latest[git]
+ action: ansible.builtin.git repo=. clone=no
+ - name: Bad git 6 <-- 3rd
+ action: ansible.builtin.git repo=. clone=no
+ always:
+ - name: Bad git 7 # noqa: latest[git]
+ action: ansible.builtin.git repo=. clone=no
+ - name: Bad git 8 <-- 4th
+ action: ansible.builtin.git repo=. clone=no
diff --git a/examples/roles/foo.yml b/examples/roles/foo.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/foo.yml
diff --git a/examples/roles/hello/meta/argument_specs.yml b/examples/roles/hello/meta/argument_specs.yml
new file mode 100644
index 0000000..47bde78
--- /dev/null
+++ b/examples/roles/hello/meta/argument_specs.yml
@@ -0,0 +1,27 @@
+---
+# https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#role-argument-validation
+argument_specs:
+ main:
+ short_description: The main entry point for the role.
+ description: "a longer description"
+ options:
+ my_app_int:
+ type: "int"
+ required: false
+ default: 42
+ description: "The integer value, defaulting to 42."
+ no_log: false
+
+ my_app_str:
+ type: "str"
+ required: true
+ description: "The string value"
+
+ alternate:
+ short_description: The alternate entry point for the my_app role.
+ options:
+ my_app_int:
+ type: "int"
+ required: false
+ default: 1024
+ description: "The integer value, defaulting to 1024."
diff --git a/examples/roles/hello/meta/main.yml b/examples/roles/hello/meta/main.yml
new file mode 100644
index 0000000..b15a998
--- /dev/null
+++ b/examples/roles/hello/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - role: bobbins
diff --git a/examples/roles/include_in_the_place/tasks/included_file.yml b/examples/roles/include_in_the_place/tasks/included_file.yml
new file mode 100644
index 0000000..8dd30a3
--- /dev/null
+++ b/examples/roles/include_in_the_place/tasks/included_file.yml
@@ -0,0 +1,4 @@
+---
+- name: included_file | Test Fixture
+ ansible.builtin.debug:
+ msg: "was found & included"
diff --git a/examples/roles/include_in_the_place/tasks/main.yml b/examples/roles/include_in_the_place/tasks/main.yml
new file mode 100644
index 0000000..4e0d500
--- /dev/null
+++ b/examples/roles/include_in_the_place/tasks/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Include a task
+ ansible.builtin.include_tasks: included_file.yml
diff --git a/examples/roles/include_miss/tasks/main.yml b/examples/roles/include_miss/tasks/main.yml
new file mode 100644
index 0000000..7df4ff2
--- /dev/null
+++ b/examples/roles/include_miss/tasks/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Include a missing file
+ ansible.builtin.include_tasks: tasks/noexist_file.yml
diff --git a/examples/roles/include_relative/tasks/included_file.yml b/examples/roles/include_relative/tasks/included_file.yml
new file mode 100644
index 0000000..ef81833
--- /dev/null
+++ b/examples/roles/include_relative/tasks/included_file.yml
@@ -0,0 +1,4 @@
+---
+- name: included_file | Sample debug task
+ ansible.builtin.debug:
+ msg: "was found & included"
diff --git a/examples/roles/include_relative/tasks/main.yml b/examples/roles/include_relative/tasks/main.yml
new file mode 100644
index 0000000..de69255
--- /dev/null
+++ b/examples/roles/include_relative/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+# ansible allow paths relative to role directory
+- name: 1st include
+ ansible.builtin.include_tasks: tasks/included_file.yml
+# relative to the current file, same effect as previous line
+- name: 2nd include
+ ansible.builtin.include_tasks: included_file.yml
diff --git a/examples/roles/invalid-name/tasks/main.yaml b/examples/roles/invalid-name/tasks/main.yaml
new file mode 100644
index 0000000..228dca3
--- /dev/null
+++ b/examples/roles/invalid-name/tasks/main.yaml
@@ -0,0 +1,4 @@
+---
+- name: Foo
+ ansible.builtin.debug:
+ msg: foo
diff --git a/examples/roles/invalid_due_syntax/tasks/main.yml b/examples/roles/invalid_due_syntax/tasks/main.yml
new file mode 100644
index 0000000..b029f9c
--- /dev/null
+++ b/examples/roles/invalid_due_syntax/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- name: Fixture for testing syntax-check[specific] on roles
diff --git a/examples/roles/invalid_due_to_meta/meta/main.yml b/examples/roles/invalid_due_to_meta/meta/main.yml
new file mode 100644
index 0000000..c389d74
--- /dev/null
+++ b/examples/roles/invalid_due_to_meta/meta/main.yml
@@ -0,0 +1,10 @@
+---
+galaxy_info:
+ standalone: true
+ role_name: invalid-due-to-meta # <-- invalid role name
+ author: foo
+ description: foo
+ license: MIT
+ platforms:
+ - name: AIX
+ min_ansible_version: "2.7"
diff --git a/examples/roles/invalid_due_to_meta/tasks/main.yaml b/examples/roles/invalid_due_to_meta/tasks/main.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/invalid_due_to_meta/tasks/main.yaml
diff --git a/examples/roles/invalid_meta_schema/meta/main.yml b/examples/roles/invalid_meta_schema/meta/main.yml
new file mode 100644
index 0000000..c8ea8e2
--- /dev/null
+++ b/examples/roles/invalid_meta_schema/meta/main.yml
@@ -0,0 +1,9 @@
+---
+galaxy_info:
+ standalone: true
+ author: foo
+ description: false # <-- schema fail as string is expected
+ license: XXX
+ platforms:
+ - name: AIX
+ min_ansible_version: "2.7"
diff --git a/examples/roles/invalid_requirements_schema/meta/requirements.yml b/examples/roles/invalid_requirements_schema/meta/requirements.yml
new file mode 100644
index 0000000..41a70af
--- /dev/null
+++ b/examples/roles/invalid_requirements_schema/meta/requirements.yml
@@ -0,0 +1,3 @@
+---
+# this should fail validation
+foo: bar
diff --git a/examples/roles/invalud_meta_schema b/examples/roles/invalud_meta_schema
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/invalud_meta_schema
diff --git a/examples/roles/loop_var_prefix/tasks/fail.yml b/examples/roles/loop_var_prefix/tasks/fail.yml
new file mode 100644
index 0000000..a349330
--- /dev/null
+++ b/examples/roles/loop_var_prefix/tasks/fail.yml
@@ -0,0 +1,46 @@
+---
+# 5 expected loop-var-prefix failures at 3, 9, 19, 26, 33
+- name: fail | That should trigger loop-var-prefix
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - foo
+ - bar
+- name: fail | That should fail due to wrong prefix
+ ansible.builtin.debug:
+ var: zz_item
+ loop:
+ - foo
+ - bar
+ loop_control:
+ loop_var: zz_item
+- name: fail | That should fail due to wrong prefix
+ ansible.builtin.debug:
+ var: zz_item
+ with_items:
+ - foo
+ - bar
+ loop_control:
+ loop_var: zz_item
+- name: fail | Using a block
+ block:
+ - name: fail | That should also not pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - apples
+ - oranges
+ rescue:
+ - name: fail | That should also not pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - avocados
+ - kiwis
+ always:
+ - name: fail | That should also not pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - bananas
+ - muscats
diff --git a/examples/roles/loop_var_prefix/tasks/pass.yml b/examples/roles/loop_var_prefix/tasks/pass.yml
new file mode 100644
index 0000000..328c0a7
--- /dev/null
+++ b/examples/roles/loop_var_prefix/tasks/pass.yml
@@ -0,0 +1,30 @@
+---
+# 0 expected loop-var-prefix failures
+- name: pass | That should pass
+ ansible.builtin.debug:
+ var: loop_var_prefix_item
+ loop:
+ - foo
+ - bar
+ loop_control:
+ loop_var: loop_var_prefix_item
+- name: pass | Using a block
+ block:
+ - name: pass | That should also pass
+ ansible.builtin.debug:
+ var: loop_var_prefix_item
+ loop:
+ - foo
+ - bar
+ loop_control:
+ loop_var: loop_var_prefix_item
+- name: pass | Using alternative double underline prefix
+ block:
+ - name: pass | That should also pass
+ ansible.builtin.debug:
+ var: __some_item
+ loop:
+ - foo
+ - bar
+ loop_control:
+ loop_var: __some_item
diff --git a/examples/roles/meta_categories_as_list/meta/main.yml b/examples/roles/meta_categories_as_list/meta/main.yml
new file mode 100644
index 0000000..d96d6d8
--- /dev/null
+++ b/examples/roles/meta_categories_as_list/meta/main.yml
@@ -0,0 +1,4 @@
+---
+galaxy_info:
+ galaxy_tags: ["database", "my s q l", "MYTAG"]
+ categories: ["networking", "posix"]
diff --git a/examples/roles/meta_incorrect_fail/meta/main.yml b/examples/roles/meta_incorrect_fail/meta/main.yml
new file mode 100644
index 0000000..af61655
--- /dev/null
+++ b/examples/roles/meta_incorrect_fail/meta/main.yml
@@ -0,0 +1,12 @@
+# Fixture for meta-incorrect
+---
+galaxy_info: # <-- 4x meta-incorrect
+ author: your name
+ description: your description
+ company: your company (optional)
+ license: license (GPLv2, CC-BY, etc)
+ min_ansible_version: "2.12"
+ platforms:
+ - name: EL
+ versions:
+ - "7"
diff --git a/examples/roles/meta_no_tags_galaxy_info/meta/main.yml b/examples/roles/meta_no_tags_galaxy_info/meta/main.yml
new file mode 100644
index 0000000..827ee5d
--- /dev/null
+++ b/examples/roles/meta_no_tags_galaxy_info/meta/main.yml
@@ -0,0 +1,2 @@
+---
+galaxy_tags: ["database", "my s q l", "MYTAG"]
diff --git a/examples/roles/meta_no_tags_valid/meta/main.yml b/examples/roles/meta_no_tags_valid/meta/main.yml
new file mode 100644
index 0000000..9f76929
--- /dev/null
+++ b/examples/roles/meta_no_tags_valid/meta/main.yml
@@ -0,0 +1,4 @@
+---
+galaxy_info:
+ galaxy_tags: ["database", "my s q l", "MYTAG"]
+ categories: "my_category_not_in_a_list"
diff --git a/examples/roles/meta_noqa/meta/main.yml b/examples/roles/meta_noqa/meta/main.yml
new file mode 100644
index 0000000..eceb660
--- /dev/null
+++ b/examples/roles/meta_noqa/meta/main.yml
@@ -0,0 +1,8 @@
+---
+galaxy_info: # noqa: meta-incorrect
+ standalone: true
+ author: your-name
+ description: missing min_ansible_version and platforms. author default not changed
+ license: MIT
+ min_ansible_version: "2.10"
+ platforms: []
diff --git a/examples/roles/meta_tags_no_list/meta/main.yml b/examples/roles/meta_tags_no_list/meta/main.yml
new file mode 100644
index 0000000..6f18d13
--- /dev/null
+++ b/examples/roles/meta_tags_no_list/meta/main.yml
@@ -0,0 +1,3 @@
+---
+galaxy_info:
+ galaxy_tags: "database"
diff --git a/examples/roles/meta_tags_not_a_string/meta/main.yml b/examples/roles/meta_tags_not_a_string/meta/main.yml
new file mode 100644
index 0000000..21f3045
--- /dev/null
+++ b/examples/roles/meta_tags_not_a_string/meta/main.yml
@@ -0,0 +1,4 @@
+---
+galaxy_info:
+ galaxy_tags: [False, "database", "my s q l", "MYTAG"]
+ categories: "networking"
diff --git a/examples/roles/meta_video_links_fail/meta/main.yml b/examples/roles/meta_video_links_fail/meta/main.yml
new file mode 100644
index 0000000..f3c42f3
--- /dev/null
+++ b/examples/roles/meta_video_links_fail/meta/main.yml
@@ -0,0 +1,27 @@
+# Test fixture for mete-video-links test
+---
+galaxy_info:
+ standalone: true
+ author: foo
+ description: bar
+ license: MIT
+ min_ansible_version: "2.12"
+ platforms:
+ - name: EL
+ versions:
+ - "9"
+ # https://github.com/ansible/galaxy/blob/devel/galaxy/importer/loaders/role.py
+ video_links:
+ - url: https://www.youtube.com/watch?v=aWmRepTSFKs&feature=youtu.be
+ title: Proper format
+ - url: https://drive.google.com/file/d/1spYR51l8SqQqvAhSdZE7/view
+ title: Check for VIDEO_REGEXP validity and break
+ - https://www.youtube.com/watch?v=aWmRepTSFKs&feature=youtu.be
+ - my_bad_key: https://www.youtube.com/watch?v=aWmRepTSFKs&feature=youtu.be
+ title: This has a bad key
+ - url: www.acme.com/vid
+ title: Bad format of url
+ # https://github.com/ansible/galaxy/blob/devel/galaxy/importer/loaders/role.py#L303
+ cloud_platforms:
+ - amazon
+ - azure
diff --git a/examples/roles/meta_video_links_pass/meta/main.yml b/examples/roles/meta_video_links_pass/meta/main.yml
new file mode 100644
index 0000000..55e19c8
--- /dev/null
+++ b/examples/roles/meta_video_links_pass/meta/main.yml
@@ -0,0 +1,13 @@
+---
+galaxy_info:
+ author: foo
+ description: bar
+ license: MIT
+ min_ansible_version: "2.12"
+ platforms:
+ - name: EL
+ versions:
+ - "9"
+ video_links:
+ - url: https://youtu.be/S49_fX47UJA
+ title: Proper format
diff --git a/examples/roles/more_complex/handlers/main.yml b/examples/roles/more_complex/handlers/main.yml
new file mode 100644
index 0000000..1476749
--- /dev/null
+++ b/examples/roles/more_complex/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Restart service using command
+ command: service bar restart
diff --git a/examples/roles/more_complex/tasks/main.yml b/examples/roles/more_complex/tasks/main.yml
new file mode 100644
index 0000000..62880a6
--- /dev/null
+++ b/examples/roles/more_complex/tasks/main.yml
@@ -0,0 +1,9 @@
+---
+- name: Test bad command
+ action: command mkdir blah
+
+- name: Test bad command v2
+ command: mkdir blah
+
+- name: Test bad local command
+ local_action: shell touch foo
diff --git a/examples/roles/role_for_no_same_owner/tasks/fail.yml b/examples/roles/role_for_no_same_owner/tasks/fail.yml
new file mode 100644
index 0000000..9c872b2
--- /dev/null
+++ b/examples/roles/role_for_no_same_owner/tasks/fail.yml
@@ -0,0 +1,77 @@
+---
+- name: fail | Block
+ block:
+ - name: fail | Synchronize-in-block
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+
+- name: fail | Synchronize
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+
+- name: fail | Nested-block
+ block:
+ - name: fail | Synchronize
+ block:
+ - name: fail | Synchronize-in-deep-block
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+ rescue:
+ - name: fail | Synchronize-in-rescue
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+ always:
+ - name: fail | Synchronize-in-always
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+
+- name: fail | Unarchive-bz2
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.bz2"
+ dest: dummy
+
+- name: fail | Unarchive delegated
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.bz2"
+ dest: dummy
+ delegate_to: localhost
+
+- name: fail | Unarchive delegated-src-no-string
+ ansible.builtin.unarchive:
+ src: 4432
+ dest: dummy
+ delegate_to: localhost
+
+- name: fail | Unarchive-gz
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.gz"
+ dest: dummy
+
+- name: fail | Unarchive-tar
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar"
+ dest: dummy
+
+- name: fail | Unarchive-xz
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.xz"
+ dest: dummy
+
+- name: fail | Unarchive-zip
+ ansible.builtin.unarchive:
+ src: "{{ file }}.zip"
+ dest: dummy
+ extra_opts:
+ - -X
+
+- name: fail | Unarchive-zip-same-owner
+ ansible.builtin.unarchive:
+ src: "{{ file }}.zip"
+ dest: dummy
+ extra_opts:
+ - -X
diff --git a/examples/roles/role_for_no_same_owner/tasks/pass.yml b/examples/roles/role_for_no_same_owner/tasks/pass.yml
new file mode 100644
index 0000000..3af914b
--- /dev/null
+++ b/examples/roles/role_for_no_same_owner/tasks/pass.yml
@@ -0,0 +1,32 @@
+---
+- name: pass | Synchronize-delegate
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+ delegate_to: localhost
+
+- name: pass | Synchronize-no-same-owner
+ ansible.posix.synchronize:
+ src: dummy
+ dest: dummy
+ owner: false
+ group: false
+
+- name: pass | Unarchive-no-same-owner
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.gz"
+ dest: dummy
+ extra_opts:
+ - --no-same-owner
+
+- name: pass | Unarchive-remote-src
+ ansible.builtin.unarchive:
+ src: "{{ file }}.tar.gz"
+ dest: dummy
+ extra_opts:
+ - --no-same-owner
+
+- name: pass | Unarchive-unknown-file-ending
+ ansible.builtin.unarchive:
+ src: "{{ file }}"
+ dest: dummy
diff --git a/examples/roles/role_with_task_inclusions/tasks/imported_tasks.yml b/examples/roles/role_with_task_inclusions/tasks/imported_tasks.yml
new file mode 100644
index 0000000..5b1257e
--- /dev/null
+++ b/examples/roles/role_with_task_inclusions/tasks/imported_tasks.yml
@@ -0,0 +1,3 @@
+---
+# this task is missing a name (name[missing])
+- ansible.builtin.ping:
diff --git a/examples/roles/role_with_task_inclusions/tasks/included_tasks.yml b/examples/roles/role_with_task_inclusions/tasks/included_tasks.yml
new file mode 100644
index 0000000..5b1257e
--- /dev/null
+++ b/examples/roles/role_with_task_inclusions/tasks/included_tasks.yml
@@ -0,0 +1,3 @@
+---
+# this task is missing a name (name[missing])
+- ansible.builtin.ping:
diff --git a/examples/roles/role_with_task_inclusions/tasks/main.yml b/examples/roles/role_with_task_inclusions/tasks/main.yml
new file mode 100644
index 0000000..46bc212
--- /dev/null
+++ b/examples/roles/role_with_task_inclusions/tasks/main.yml
@@ -0,0 +1,10 @@
+---
+- name: Include 1
+ ansible.builtin.include_tasks: included_tasks.yml
+- name: Include 2
+ ansible.builtin.import_tasks: imported_tasks.yml
+- name: Include 3
+ ansible.builtin.include_tasks:
+ file: included_tasks.yml
+ apply:
+ tags: some_tag
diff --git a/examples/roles/subfolder/1st_role/tasks/main.yml b/examples/roles/subfolder/1st_role/tasks/main.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/subfolder/1st_role/tasks/main.yml
diff --git a/examples/roles/subfolder/2nd_role/tasks/main.yml b/examples/roles/subfolder/2nd_role/tasks/main.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/subfolder/2nd_role/tasks/main.yml
diff --git a/examples/roles/subfolder/3rd_role/tasks/main.yml b/examples/roles/subfolder/3rd_role/tasks/main.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/subfolder/3rd_role/tasks/main.yml
diff --git a/examples/roles/subfolder/other_role/tasks/main.yml b/examples/roles/subfolder/other_role/tasks/main.yml
new file mode 100644
index 0000000..b4d7f48
--- /dev/null
+++ b/examples/roles/subfolder/other_role/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- name: Foo
+ debug:
+ msg: "Hello!"
diff --git a/examples/roles/template_lookup/files/a_file b/examples/roles/template_lookup/files/a_file
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/template_lookup/files/a_file
diff --git a/examples/roles/template_lookup/tasks/main.yml b/examples/roles/template_lookup/tasks/main.yml
new file mode 100644
index 0000000..db2e490
--- /dev/null
+++ b/examples/roles/template_lookup/tasks/main.yml
@@ -0,0 +1,10 @@
+---
+# Place tasks in a block as templates are not rendered for top-level tasks
+# in roles. Specifically, in `play_children()` of src/ansiblelint/utils.py,
+# tasks in blocks go through `delegate_map['block']`, while top-level tasks
+# in a role is not handled by `delegate_map`.
+# Ref: https://github.com/ansible/ansible-lint/blob/v5.0.12/src/ansiblelint/utils.py#L305
+- block:
+ - name: Bug demo
+ ansible.builtin.debug:
+ msg: '{{ lookup("file", "a_file") }}'
diff --git a/examples/roles/template_lookup_missing/tasks/main.yml b/examples/roles/template_lookup_missing/tasks/main.yml
new file mode 100644
index 0000000..fc0542c
--- /dev/null
+++ b/examples/roles/template_lookup_missing/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+# See comments in `examples/roles/template_lookup/tasks/main.yml`
+# for why the task is in a block.
+- block:
+ - name: Bug demo
+ ansible.builtin.debug:
+ msg: '{{ lookup("file", "a_file") }}'
diff --git a/examples/roles/test-role/meta/requirements.yml b/examples/roles/test-role/meta/requirements.yml
new file mode 100644
index 0000000..8e7fccc
--- /dev/null
+++ b/examples/roles/test-role/meta/requirements.yml
@@ -0,0 +1,3 @@
+---
+roles: []
+collections: []
diff --git a/examples/roles/test-role/molecule/default/include-import-role.yml b/examples/roles/test-role/molecule/default/include-import-role.yml
new file mode 100644
index 0000000..7dcd59e
--- /dev/null
+++ b/examples/roles/test-role/molecule/default/include-import-role.yml
@@ -0,0 +1,6 @@
+---
+- name: Fixture for test_run_playbook test
+ gather_facts: false
+ hosts: all
+ roles:
+ - role: test-role
diff --git a/examples/roles/test-role/tasks/main.yml b/examples/roles/test-role/tasks/main.yml
new file mode 100644
index 0000000..8e5402f
--- /dev/null
+++ b/examples/roles/test-role/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- name: Shell instead of command
+ ansible.builtin.shell:
+ cmd: echo hello world
diff --git a/examples/roles/test-role/tasks/world.yml b/examples/roles/test-role/tasks/world.yml
new file mode 100644
index 0000000..3f3fd3e
--- /dev/null
+++ b/examples/roles/test-role/tasks/world.yml
@@ -0,0 +1,3 @@
+---
+- command: # noqa: fqcn
+ cmd: echo this is a task without a name # noqa: no-free-form
diff --git a/examples/roles/valid-due-to-meta/meta/main.yml b/examples/roles/valid-due-to-meta/meta/main.yml
new file mode 100644
index 0000000..32fc400
--- /dev/null
+++ b/examples/roles/valid-due-to-meta/meta/main.yml
@@ -0,0 +1,10 @@
+---
+galaxy_info:
+ standalone: true
+ role_name: valid_due_to_meta
+ author: foo
+ description: foo
+ license: MIT
+ platforms:
+ - name: Fedora
+ min_ansible_version: "2.7"
diff --git a/examples/roles/valid-due-to-meta/tasks/debian/main.yml b/examples/roles/valid-due-to-meta/tasks/debian/main.yml
new file mode 100644
index 0000000..6fa48c2
--- /dev/null
+++ b/examples/roles/valid-due-to-meta/tasks/debian/main.yml
@@ -0,0 +1,2 @@
+# This empty task file is here to test that roles with tasks organized in subdirectories
+# are handled correctly by ansible-lint.
diff --git a/examples/roles/valid-due-to-meta/tasks/main.yaml b/examples/roles/valid-due-to-meta/tasks/main.yaml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/roles/valid-due-to-meta/tasks/main.yaml
diff --git a/examples/roles/var_naming_pattern/.ansible-lint b/examples/roles/var_naming_pattern/.ansible-lint
new file mode 100644
index 0000000..d6dc161
--- /dev/null
+++ b/examples/roles/var_naming_pattern/.ansible-lint
@@ -0,0 +1,2 @@
+---
+var_naming_pattern: "^[a-z][a-z0-9_]*[a-z0-9]__[a-z][a-z0-9_]*[a-z0-9]$"
diff --git a/examples/roles/var_naming_pattern/tasks/cacheable_set_fact.yml b/examples/roles/var_naming_pattern/tasks/cacheable_set_fact.yml
new file mode 100644
index 0000000..23113eb
--- /dev/null
+++ b/examples/roles/var_naming_pattern/tasks/cacheable_set_fact.yml
@@ -0,0 +1,5 @@
+---
+- name: cacheable_set_fact | Using set_fact with cacheable
+ ansible.builtin.set_fact:
+ var_naming_pattern_fact: bar
+ cacheable: true
diff --git a/examples/roles/var_naming_pattern/tasks/include_task_with_vars.yml b/examples/roles/var_naming_pattern/tasks/include_task_with_vars.yml
new file mode 100644
index 0000000..5151cd3
--- /dev/null
+++ b/examples/roles/var_naming_pattern/tasks/include_task_with_vars.yml
@@ -0,0 +1,13 @@
+---
+- name: include_task_with_vars | Foo
+ ansible.builtin.include_tasks: ../tasks/included-task-with-vars.yml
+ vars:
+ var_naming_pattern_foo: bar
+
+- name: include_task_with_vars | Foo
+ ansible.builtin.include_role:
+ name: bobbins
+ vars:
+ bobbins_foo: bar
+ # ^ this is valid because for include/import, the prefix should be of the
+ # included role and from of the current role.
diff --git a/examples/roles/var_naming_pattern/tasks/main.yml b/examples/roles/var_naming_pattern/tasks/main.yml
new file mode 100644
index 0000000..896a7f2
--- /dev/null
+++ b/examples/roles/var_naming_pattern/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- name: Foobar
+ ansible.builtin.set_fact:
+ var_naming_pattern__namespace: "foo"
diff --git a/examples/rulebooks/rulebook-fail.yml b/examples/rulebooks/rulebook-fail.yml
new file mode 100644
index 0000000..11472b4
--- /dev/null
+++ b/examples/rulebooks/rulebook-fail.yml
@@ -0,0 +1,21 @@
+---
+- name: Sample rulebooks
+ hosts: all
+ that_should_not_be_here: foo
+ sources: # should be "sources"
+ - name: listen for alerts
+ ansible.eda.alertmanager:
+ host: 0.0.0.0
+ port: 8000
+ rules:
+ - name: restart web server
+ condition: event.alert.labels.job == "fastapi" and event.alert.status == "firing"
+ action:
+ run_playbook:
+ name: ansible.eda.start_app
+ copy_files: true
+ post_events: true
+ - name: debug
+ condition: event.alert.labels.job == "fastapi"
+ action:
+ debug: sss
diff --git a/examples/rulebooks/rulebook-pass.yml b/examples/rulebooks/rulebook-pass.yml
new file mode 100644
index 0000000..02af780
--- /dev/null
+++ b/examples/rulebooks/rulebook-pass.yml
@@ -0,0 +1,15 @@
+---
+- name: Demo rules with kafka as source
+ hosts: localhost
+ sources:
+ - name: kafka
+ kafka:
+ topic: eda
+ host: localhost
+ port: 9092
+ group_id: testing
+ rules:
+ - name: Demo rule
+ condition: event.i is defined
+ action:
+ debug:
diff --git a/examples/rules/task_has_tag.py b/examples/rules/task_has_tag.py
new file mode 100644
index 0000000..a4b927c
--- /dev/null
+++ b/examples/rules/task_has_tag.py
@@ -0,0 +1,44 @@
+"""Example implementation of a rule requiring tasks to have tags set."""
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+from ansiblelint.rules import AnsibleLintRule
+
+if TYPE_CHECKING:
+ from ansiblelint.file_utils import Lintable
+ from ansiblelint.utils import Task
+
+
+class TaskHasTag(AnsibleLintRule):
+ """Tasks must have tag."""
+
+ id = "EXAMPLE001"
+ description = "Tasks must have tag"
+ tags = ["productivity", "tags"]
+
+ def matchtask(
+ self,
+ task: Task,
+ file: Lintable | None = None,
+ ) -> bool | str:
+ """Task matching method."""
+ if isinstance(task, str):
+ return False
+
+ # If the task include another task or make the playbook fail
+ # Don't force to have a tag
+ if not set(task.keys()).isdisjoint(["include", "fail"]):
+ return False
+
+ if not set(task.keys()).isdisjoint(["include_tasks", "fail"]):
+ return False
+
+ if not set(task.keys()).isdisjoint(["import_tasks", "fail"]):
+ return False
+
+ # Task should have tags
+ if "tags" not in task:
+ return True
+
+ return False
diff --git a/examples/sanity_ignores/tests/sanity/ignore-2.13.txt b/examples/sanity_ignores/tests/sanity/ignore-2.13.txt
new file mode 100644
index 0000000..2b95cf5
--- /dev/null
+++ b/examples/sanity_ignores/tests/sanity/ignore-2.13.txt
@@ -0,0 +1 @@
+plugins/module_utils/ansible_example_module.py validate-modules:deprecation-mismatch # comment
diff --git a/examples/sanity_ignores/tests/sanity/ignore-2.15.txt b/examples/sanity_ignores/tests/sanity/ignore-2.15.txt
new file mode 100644
index 0000000..069ef15
--- /dev/null
+++ b/examples/sanity_ignores/tests/sanity/ignore-2.15.txt
@@ -0,0 +1,2 @@
+plugins/module_utils/ansible_example_module.incorrect-3.6!skip
+#plugins/module_utils/ansible_example_module.py import-3.6!skip
diff --git a/examples/sanity_ignores/tests/sanity/ignore-2.9.txt b/examples/sanity_ignores/tests/sanity/ignore-2.9.txt
new file mode 100644
index 0000000..bfee509
--- /dev/null
+++ b/examples/sanity_ignores/tests/sanity/ignore-2.9.txt
@@ -0,0 +1,2 @@
+plugins/module_utils/ansible_example_module.py validate-modules:deprecation-mismatch
+plugins/module_utils/ansible_example_module.py import-2.6!skip
diff --git a/examples/site.yml b/examples/site.yml
new file mode 100644
index 0000000..dff8dd6
--- /dev/null
+++ b/examples/site.yml
@@ -0,0 +1,4 @@
+---
+# site.yml
+- ansible.builtin.import_playbook: playbooks/play.yml
+- ansible.builtin.import_playbook: playbooks/playbook-parent.yml
diff --git a/examples/templates/playbooks/playbook.yml b/examples/templates/playbooks/playbook.yml
new file mode 100644
index 0000000..bf85245
--- /dev/null
+++ b/examples/templates/playbooks/playbook.yml
@@ -0,0 +1,6 @@
+---
+# even if is hosted under playbooks and is named playbook.yml, this file
+# is not a real playbook because it is hosted in a "templates" directory
+# and that means we will avoid processing it as a playbook. Templates use
+# either jinja2 or another templating engine, so we cannot load them.
+foo: bar
diff --git a/examples/test_collection/README.md b/examples/test_collection/README.md
new file mode 100644
index 0000000..b4aaea4
--- /dev/null
+++ b/examples/test_collection/README.md
@@ -0,0 +1,3 @@
+# Ansible Collection - example.test_collection
+
+Documentation for the collection.
diff --git a/examples/test_collection/galaxy.yml b/examples/test_collection/galaxy.yml
new file mode 100644
index 0000000..633719b
--- /dev/null
+++ b/examples/test_collection/galaxy.yml
@@ -0,0 +1,67 @@
+---
+### REQUIRED
+# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
+# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
+# underscores or numbers and cannot contain consecutive underscores
+namespace: examples
+
+# The name of the collection. Has the same character restrictions as 'namespace'
+name: test_collection
+
+# The version of the collection. Must be compatible with semantic versioning
+version: 1.0.0
+
+# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
+readme: README.md
+
+# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
+# @nicks:irc/im.site#channel'
+authors:
+ - your name <example@domain.com>
+
+### OPTIONAL but strongly recommended
+# A short summary description of the collection
+description: your collection description
+
+# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
+# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
+license:
+ - GPL-2.0-or-later
+
+# The path to the license file for the collection. This path is relative to the root of the collection. This key is
+# mutually exclusive with 'license'
+license_file: ""
+
+# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
+# requirements as 'namespace' and 'name'
+tags: []
+
+# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
+# collection label 'namespace.name'. The value is a version range
+# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
+# range specifiers can be set and are separated by ','
+dependencies: {}
+
+# The URL of the originating SCM repository
+repository: http://example.com/repository
+
+# The URL to any online docs
+documentation: http://docs.example.com
+
+# The URL to the homepage of the collection/project
+homepage: http://example.com
+
+# The URL to the collection issue tracker
+issues: http://example.com/issue/tracker
+
+# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
+# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
+# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
+# and '.git' are always filtered. Mutually exclusive with 'manifest'
+build_ignore: []
+# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
+# list of MANIFEST.in style
+# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key
+# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive
+# with 'build_ignore'
+# manifest: null
diff --git a/examples/test_collection/roles/my_role/tasks/main.yml b/examples/test_collection/roles/my_role/tasks/main.yml
new file mode 100644
index 0000000..784a814
--- /dev/null
+++ b/examples/test_collection/roles/my_role/tasks/main.yml
@@ -0,0 +1,13 @@
+---
+- name: Task
+ ansible.builtin.include_role:
+ name: example.test_collection.my_role2
+ vars:
+ my_role2_foo: something
+
+- name: Task 2
+ # this task should NOT trigger var-naming[no-role-prefix]
+ vars:
+ foo: bar
+ ansible.builtin.debug:
+ msg: "{{ foo }}"
diff --git a/examples/test_collection/roles/my_role2/tasks/main.yml b/examples/test_collection/roles/my_role2/tasks/main.yml
new file mode 100644
index 0000000..27954a5
--- /dev/null
+++ b/examples/test_collection/roles/my_role2/tasks/main.yml
@@ -0,0 +1,4 @@
+---
+- name: Task
+ ansible.builtin.debug:
+ msg: "{{ my_role2_foo }}"
diff --git a/examples/testproject/roles/test-role/tasks/main.yml b/examples/testproject/roles/test-role/tasks/main.yml
new file mode 100644
index 0000000..fda441f
--- /dev/null
+++ b/examples/testproject/roles/test-role/tasks/main.yml
@@ -0,0 +1,3 @@
+---
+- name: Shell instead of command
+ shell: echo hello world
diff --git a/examples/yamllint/invalid.yml b/examples/yamllint/invalid.yml
new file mode 100644
index 0000000..44e4072
--- /dev/null
+++ b/examples/yamllint/invalid.yml
@@ -0,0 +1,9 @@
+# missing document-start
+foo: ...
+foo: ... # <-- key-duplicates
+bar: ... # <-- wrong comment indentation
+
+# next line has trailing-spaces:
+other: aaa
+
+# ^ empty-lines
diff --git a/examples/yamllint/line-length.yml b/examples/yamllint/line-length.yml
new file mode 100644
index 0000000..80e81b9
--- /dev/null
+++ b/examples/yamllint/line-length.yml
@@ -0,0 +1,4 @@
+---
+- name: Task example
+ debug:
+ msg: "This is a very long text that is used in order to verify the rule that checks for very long lines. We do hope it was long enough to go over the line limit."
diff --git a/examples/yamllint/multi-document.yaml b/examples/yamllint/multi-document.yaml
new file mode 100644
index 0000000..e3d8805
--- /dev/null
+++ b/examples/yamllint/multi-document.yaml
@@ -0,0 +1,4 @@
+---
+foo: ...
+---
+bar: ...
diff --git a/examples/yamllint/skipped-rule.yml b/examples/yamllint/skipped-rule.yml
new file mode 100644
index 0000000..e63f91b
--- /dev/null
+++ b/examples/yamllint/skipped-rule.yml
@@ -0,0 +1,3 @@
+---
+- test: skipped_rule # noqa name
+- other: aaa
diff --git a/examples/yamllint/valid.yml b/examples/yamllint/valid.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/yamllint/valid.yml