summaryrefslogtreecommitdiffstats
path: root/test/schemas/test
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 /test/schemas/test
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 '')
-rw-r--r--test/schemas/test/.config/ansible-lint.yml9
-rw-r--r--test/schemas/test/ansible-navigator.yml85
-rw-r--r--test/schemas/test/changelog.yml47
-rw-r--r--test/schemas/test/changelogs/maximal/changelog.yaml61
-rw-r--r--test/schemas/test/changelogs/minimal/changelog.yaml3
-rw-r--r--test/schemas/test/execution-environment-v3.yml19
-rw-r--r--test/schemas/test/execution-environment.yml21
-rw-r--r--test/schemas/test/galaxy.yml17
-rw-r--r--test/schemas/test/inventory.yml13
-rw-r--r--test/schemas/test/inventory/inventory.yml31
-rw-r--r--test/schemas/test/inventory/production.yml37
-rw-r--r--test/schemas/test/meta/requirements.yml3
-rw-r--r--test/schemas/test/meta/runtime.yml1
-rw-r--r--test/schemas/test/molecule/cluster/base.yml0
-rw-r--r--test/schemas/test/molecule/cluster/converge.yml0
-rw-r--r--test/schemas/test/molecule/cluster/foobar.yml0
-rw-r--r--test/schemas/test/molecule/cluster/molecule.yml76
-rw-r--r--test/schemas/test/molecule/default/molecule.yml117
-rw-r--r--test/schemas/test/molecule/vagrant/molecule.yml46
-rw-r--r--test/schemas/test/playbooks/block.yml10
-rw-r--r--test/schemas/test/playbooks/defaults/foo.yml3
-rw-r--r--test/schemas/test/playbooks/environment.yml7
-rw-r--r--test/schemas/test/playbooks/failed_when.yml18
-rw-r--r--test/schemas/test/playbooks/full-jinja.yml16
-rw-r--r--test/schemas/test/playbooks/gather_facts.yml6
-rw-r--r--test/schemas/test/playbooks/gather_subset.yml15
-rw-r--r--test/schemas/test/playbooks/ignore_errors..yml9
-rw-r--r--test/schemas/test/playbooks/import_playbook.yml9
-rw-r--r--test/schemas/test/playbooks/included.yml1
-rw-r--r--test/schemas/test/playbooks/integers.yml23
-rw-r--r--test/schemas/test/playbooks/local_action_dict.yml5
-rw-r--r--test/schemas/test/playbooks/local_action_string.yml3
-rw-r--r--test/schemas/test/playbooks/loop.yml9
-rw-r--r--test/schemas/test/playbooks/no_log.yml11
-rw-r--r--test/schemas/test/playbooks/roles.yml13
-rw-r--r--test/schemas/test/playbooks/run.yml42
-rw-r--r--test/schemas/test/playbooks/run_once.yml6
-rw-r--r--test/schemas/test/playbooks/tags.yml23
-rw-r--r--test/schemas/test/playbooks/tasks.yml5
-rw-r--r--test/schemas/test/playbooks/tasks/args.yml4
-rw-r--r--test/schemas/test/playbooks/tasks/become_method.yml7
-rw-r--r--test/schemas/test/playbooks/tasks/changed_when.yml10
-rw-r--r--test/schemas/test/playbooks/tasks/diff.yml4
-rw-r--r--test/schemas/test/playbooks/tasks/empty_tasks.yml2
-rw-r--r--test/schemas/test/playbooks/tasks/ignore_errors.yml7
-rw-r--r--test/schemas/test/playbooks/tasks/local_action_dict.yml3
-rw-r--r--test/schemas/test/playbooks/tasks/local_action_string.yml1
-rw-r--r--test/schemas/test/playbooks/tasks/loop.yml6
-rw-r--r--test/schemas/test/playbooks/tasks/no_log.yml11
-rw-r--r--test/schemas/test/playbooks/tasks/notify.yml11
-rw-r--r--test/schemas/test/playbooks/tasks/run_once.yml9
-rw-r--r--test/schemas/test/playbooks/tasks/some_tasks.yml8
-rw-r--r--test/schemas/test/playbooks/tasks/tags.yml29
-rw-r--r--test/schemas/test/playbooks/tasks/templated_become.yml12
-rw-r--r--test/schemas/test/playbooks/tasks/templated_integers.yml5
-rw-r--r--test/schemas/test/playbooks/tasks/throttled.yml5
-rw-r--r--test/schemas/test/playbooks/tasks/until.yml14
-rw-r--r--test/schemas/test/playbooks/tasks/when.yml10
-rw-r--r--test/schemas/test/playbooks/tasks/with_items.yml16
-rw-r--r--test/schemas/test/playbooks/templated_become.yml16
-rw-r--r--test/schemas/test/playbooks/user_valid.yml3
-rw-r--r--test/schemas/test/playbooks/var_files.yml18
-rw-r--r--test/schemas/test/playbooks/vars/empty_vars.yml2
-rw-r--r--test/schemas/test/playbooks/vars/encrypted.yml6
-rw-r--r--test/schemas/test/playbooks/vars/myvars.yml9
-rw-r--r--test/schemas/test/playbooks/vars_prompt.yml11
-rw-r--r--test/schemas/test/playbooks/when.yml11
-rw-r--r--test/schemas/test/playbooks/with_.yml34
-rw-r--r--test/schemas/test/reqs2/meta/requirements.yml7
-rw-r--r--test/schemas/test/reqs4/meta/requirements.yml6
-rw-r--r--test/schemas/test/reqs5/meta/requirements.yml3
-rw-r--r--test/schemas/test/roles/empty-meta/meta/main.yml1
-rw-r--r--test/schemas/test/roles/foo/meta/argument_specs.yml74
-rw-r--r--test/schemas/test/roles/foo/meta/main.yml46
-rw-r--r--test/schemas/test/roles/foo/meta/runtime.yml39
-rw-r--r--test/schemas/test/roles/maximum/meta/main.yml20
-rw-r--r--test/schemas/test/roles/meta-tags/meta/main.yml25
-rw-r--r--test/schemas/test/roles/ns/meta/main.yml13
-rw-r--r--test/schemas/test/roles/v1_role/meta/main.yml12
-rw-r--r--test/schemas/test/tests/integration/rom_role/meta/main.yml5
80 files changed, 1355 insertions, 0 deletions
diff --git a/test/schemas/test/.config/ansible-lint.yml b/test/schemas/test/.config/ansible-lint.yml
new file mode 100644
index 0000000..0e7d05d
--- /dev/null
+++ b/test/schemas/test/.config/ansible-lint.yml
@@ -0,0 +1,9 @@
+---
+# .ansible-lint
+profile: basic
+rules:
+ name[missing]:
+ exclude_paths: []
+ custom-inc-rule:
+ exclude_paths:
+ - "tests/*.yml"
diff --git a/test/schemas/test/ansible-navigator.yml b/test/schemas/test/ansible-navigator.yml
new file mode 100644
index 0000000..e627b78
--- /dev/null
+++ b/test/schemas/test/ansible-navigator.yml
@@ -0,0 +1,85 @@
+---
+ansible-navigator:
+ ansible:
+ config: /tmp/ansible.cfg
+ cmdline: "--forks 15"
+ inventories:
+ - /tmp/test_inventory.yml
+ playbook: /tmp/test_playbook.yml
+
+ ansible-builder:
+ workdir: /tmp/
+
+ ansible-runner:
+ artifact-dir: /tmp/test1
+ rotate-artifacts-count: 10
+ timeout: 300
+
+ app: run
+
+ collection-doc-cache-path: /tmp/cache.db
+
+ color:
+ enable: False
+ osc4: False
+
+ documentation:
+ plugin:
+ name: shell
+ type: become
+
+ editor:
+ command: vim_from_setting
+ console: False
+
+ exec:
+ shell: False
+ command: /bin/foo
+
+ execution-environment:
+ container-engine: podman
+ enabled: False
+ environment-variables:
+ pass:
+ - ONE
+ - TWO
+ - THREE
+ set:
+ KEY1: VALUE1
+ KEY2: VALUE2
+ KEY3: VALUE3
+ image: test_image:latest
+ pull-policy: never
+ volume-mounts:
+ - src: "/test1"
+ dest: "/test1"
+ label: "Z"
+ container-options:
+ - "--net=host"
+
+ help-builder: False
+
+ help-config: True
+
+ help-doc: True
+
+ help-inventory: True
+
+ help-playbook: False
+
+ inventory-columns:
+ - ansible_network_os
+ - ansible_network_cli_ssh_type
+ - ansible_connection
+
+ logging:
+ level: critical
+ append: False
+ file: /tmp/log.txt
+
+ mode: stdout
+
+ playbook-artifact:
+ enable: True
+ replay: /tmp/test_artifact.json
+ save-as: /tmp/test_artifact.json
diff --git a/test/schemas/test/changelog.yml b/test/schemas/test/changelog.yml
new file mode 100644
index 0000000..99bcb2f
--- /dev/null
+++ b/test/schemas/test/changelog.yml
@@ -0,0 +1,47 @@
+ancestor: 0.5.4
+releases:
+ 1.0.0-alpha:
+ release_date: "2020-01-01"
+ codename: "The first public one"
+ changes:
+ release_summary: A bit o markdown text
+ major_changes:
+ - Free form text mentioning a major change
+ minor_changes:
+ - Free form text mentioning a minor change
+ breaking_changes:
+ - Free form text mentioning a breaking change
+ deprecated_features:
+ - A list of strings describing features deprecated in this release
+ removed_features:
+ - A list of strings describing features removed in this release
+ security_fixes:
+ - A list of strings describing security-relevant bugfixes
+ bugfixes:
+ - Fixed bug `#1 <https://example.com>`
+ known_issues:
+ - A list of strings describing known issues that are currently not fixed or will not be fixed
+ trivial:
+ - A list of strings describing changes that are too trivial to show in the changelog
+ modules:
+ - name: short_module_name
+ description: foo
+ namespace: foo
+ plugins:
+ lookup:
+ - name: reverse
+ description: Reverse magic
+ namespace: null
+ inventory:
+ - name: docker
+ description: Inventory plugin for docker containers
+ namespace: null
+ objects:
+ role:
+ - name: install_reqs
+ description: Install all requirements of this collection
+ namespace: null
+ playbook:
+ - name: wipe_personal_data
+ description: Wipes all personal data from the database
+ namespace: null
diff --git a/test/schemas/test/changelogs/maximal/changelog.yaml b/test/schemas/test/changelogs/maximal/changelog.yaml
new file mode 100644
index 0000000..8e063c7
--- /dev/null
+++ b/test/schemas/test/changelogs/maximal/changelog.yaml
@@ -0,0 +1,61 @@
+---
+# Example of minimal changelogs/changelog.yaml that is considered valid
+ancestor: null
+
+releases:
+ 1.0.0-alpha:
+ release_date: "1980-01-01"
+ codename: foo
+ fragments: []
+ changes:
+ release_summary: This is the initial White Rabbit release. Enjoy!
+ major_changes:
+ - The authentication method handling has been rewritten.
+ minor_changes:
+ - foo - Module can now reformat hard disks without asking.
+ - bob lookup - Makes sure Bob isn't there multiple times.
+ breaking_changes:
+ - Due to the security bug in the post module, the module no longer accepts the password
+ option. Please stop using the option and change any password you ever supplied to the
+ module.
+ deprecated_features:
+ - foo - The bar option has been deprecated. Use the username option instead.
+ - send_request - The quick option has been deprecated. Use the protocol option instead.
+ removed_features:
+ - foo - The baz option has been removed. It has never been used anyway.
+ security_fixes:
+ - post - The module accidentally sent your password in plaintext to all servers it could find.
+ bugfixes:
+ - post - The module made PUT requests instead of POST requests.
+ - get - The module will no longer crash if it received invalid JSON data
+ trivial:
+ - something that is not included in release notes
+ known_issues:
+ - som other
+ xxx:
+ - we should ignore unknown keys because user can define custom section in changelogs/config.yaml file
+ modules:
+ - name: head
+ description: Make a HEAD request
+ namespace: "net_tools.rest"
+ - name: echo
+ description: Echo params
+ namespace: ""
+ plugins:
+ lookup:
+ - name: reverse
+ description: Reverse magic
+ namespace: null
+ inventory:
+ - name: docker
+ description: Inventory plugin for docker containers
+ namespace: null
+ objects:
+ role:
+ - name: install_reqs
+ description: Install all requirements of this collection
+ namespace: null
+ playbook:
+ - name: wipe_personal_data
+ description: Wipes all personal data from the database
+ namespace: null
diff --git a/test/schemas/test/changelogs/minimal/changelog.yaml b/test/schemas/test/changelogs/minimal/changelog.yaml
new file mode 100644
index 0000000..d1618f0
--- /dev/null
+++ b/test/schemas/test/changelogs/minimal/changelog.yaml
@@ -0,0 +1,3 @@
+---
+# Example of minimal changelogs/changelog.yaml that is considered valid
+releases: {}
diff --git a/test/schemas/test/execution-environment-v3.yml b/test/schemas/test/execution-environment-v3.yml
new file mode 100644
index 0000000..edc4fe2
--- /dev/null
+++ b/test/schemas/test/execution-environment-v3.yml
@@ -0,0 +1,19 @@
+---
+version: 3
+
+images:
+ base_image:
+ name: "quay.io/ansible/ansible-runner:stable-2.10-devel"
+
+dependencies:
+ galaxy: requirements.yml
+ python: requirements.txt
+ system: bindep.txt
+
+additional_build_steps:
+ prepend_base: |
+ RUN whoami
+ RUN cat /etc/os-release
+ append_base:
+ - RUN echo This is a post-install command!
+ - RUN ls -la /etc
diff --git a/test/schemas/test/execution-environment.yml b/test/schemas/test/execution-environment.yml
new file mode 100644
index 0000000..e447a9a
--- /dev/null
+++ b/test/schemas/test/execution-environment.yml
@@ -0,0 +1,21 @@
+---
+# Example from https://docs.ansible.com/automation-controller/latest/html/userguide/ee_reference.html
+version: 1
+
+build_arg_defaults:
+ EE_BASE_IMAGE: "quay.io/ansible/ansible-runner:stable-2.10-devel"
+
+ansible_config: "ansible.cfg"
+
+dependencies:
+ galaxy: requirements.yml
+ python: requirements.txt
+ system: bindep.txt
+
+additional_build_steps:
+ prepend: |
+ RUN whoami
+ RUN cat /etc/os-release
+ append:
+ - RUN echo This is a post-install command!
+ - RUN ls -la /etc
diff --git a/test/schemas/test/galaxy.yml b/test/schemas/test/galaxy.yml
new file mode 100644
index 0000000..004344f
--- /dev/null
+++ b/test/schemas/test/galaxy.yml
@@ -0,0 +1,17 @@
+name: foo
+namespace: bar
+version: 1.2.3
+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
+# upload to galaxy will fail if a repository key is not present
+repository: https://www.github.com/my_org/my_collection
+manifest:
+ directives:
+ - "foo"
+ omit_default_directives: true
diff --git a/test/schemas/test/inventory.yml b/test/schemas/test/inventory.yml
new file mode 100644
index 0000000..48a0e6a
--- /dev/null
+++ b/test/schemas/test/inventory.yml
@@ -0,0 +1,13 @@
+all:
+ hosts:
+ mail.example.com:
+ children:
+ webservers:
+ hosts:
+ foo.example.com:
+ bar[01:50:2].example.com:
+ dbservers:
+ hosts:
+ one.example.com:
+ two.example.com:
+ three.example.com:
diff --git a/test/schemas/test/inventory/inventory.yml b/test/schemas/test/inventory/inventory.yml
new file mode 100644
index 0000000..8752d9b
--- /dev/null
+++ b/test/schemas/test/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/test/schemas/test/inventory/production.yml b/test/schemas/test/inventory/production.yml
new file mode 100644
index 0000000..6350bda
--- /dev/null
+++ b/test/schemas/test/inventory/production.yml
@@ -0,0 +1,37 @@
+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/test/schemas/test/meta/requirements.yml b/test/schemas/test/meta/requirements.yml
new file mode 100644
index 0000000..6b07e4f
--- /dev/null
+++ b/test/schemas/test/meta/requirements.yml
@@ -0,0 +1,3 @@
+# requirements v2
+collections: []
+roles: []
diff --git a/test/schemas/test/meta/runtime.yml b/test/schemas/test/meta/runtime.yml
new file mode 100644
index 0000000..6a992c4
--- /dev/null
+++ b/test/schemas/test/meta/runtime.yml
@@ -0,0 +1 @@
+requires_ansible: ">=2.12,<2.14"
diff --git a/test/schemas/test/molecule/cluster/base.yml b/test/schemas/test/molecule/cluster/base.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/schemas/test/molecule/cluster/base.yml
diff --git a/test/schemas/test/molecule/cluster/converge.yml b/test/schemas/test/molecule/cluster/converge.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/schemas/test/molecule/cluster/converge.yml
diff --git a/test/schemas/test/molecule/cluster/foobar.yml b/test/schemas/test/molecule/cluster/foobar.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/schemas/test/molecule/cluster/foobar.yml
diff --git a/test/schemas/test/molecule/cluster/molecule.yml b/test/schemas/test/molecule/cluster/molecule.yml
new file mode 100644
index 0000000..f3e586c
--- /dev/null
+++ b/test/schemas/test/molecule/cluster/molecule.yml
@@ -0,0 +1,76 @@
+---
+dependency:
+ name: galaxy
+
+driver:
+ name: docker
+
+lint: |
+ set -e
+ yamllint -c molecule/yaml-lint.yml .
+ ansible-lint
+
+platforms:
+ - name: instance-1
+ image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ volumes:
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ privileged: true
+ pre_build_image: true
+ groups:
+ - zookeeper
+ env:
+ - Hello: world!
+
+ - name: instance-2
+ image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ volumes:
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ privileged: true
+ pre_build_image: true
+ groups:
+ - zookeeper
+ env:
+ - Hello: world!
+
+ - name: instance-3
+ image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
+ command: ${MOLECULE_DOCKER_COMMAND:-""}
+ volumes:
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ privileged: true
+ pre_build_image: true
+ groups:
+ - zookeeper
+ env:
+ - Hello: world!
+
+provisioner:
+ name: ansible
+ log: false
+ playbooks:
+ converge: ${MOLECULE_PLAYBOOK:-converge.yml}
+ inventory:
+ host_vars:
+ instance-1:
+ zookeeper_id: 0
+ instance-2:
+ zookeeper_id: 1
+ instance-3:
+ zookeeper_id: 2
+
+scenario:
+ name: cluster
+ test_sequence:
+ - destroy
+ - create
+ - prepare
+ - converge
+ - check
+ - verify
+ - destroy
+
+verifier:
+ name: ansible
diff --git a/test/schemas/test/molecule/default/molecule.yml b/test/schemas/test/molecule/default/molecule.yml
new file mode 100644
index 0000000..b573e74
--- /dev/null
+++ b/test/schemas/test/molecule/default/molecule.yml
@@ -0,0 +1,117 @@
+---
+dependency:
+ name: shell
+ enabled: true
+ command: path/to/command --flag1 subcommand --flag2
+ options:
+ ignore-certs: true
+ ignore-errors: true
+ env:
+ FOO: bar
+
+lint: |
+ set -e
+ yamllint .
+ ansible-lint
+
+driver:
+ name: podman
+ options:
+ managed: false
+ login_cmd_template: ...
+ ansible_connection_options:
+ ansible_connection: ssh
+ # vagrant options:
+ provider:
+ name: virtualbox
+
+log: true
+
+platforms:
+ - name: ubi8
+ hostname: ubi8
+ children: [] # list of strings
+ unknown_property_foo: bar # unknown properties should be allowed for drivers
+ groups:
+ - ubi8
+ image: ubi8/ubi-init
+ pre_build_image: true
+ registry:
+ url: registry.access.redhat.com
+ dockerfile: Dockerfile
+ pkg_extras: python*setuptools
+ volumes:
+ - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
+ - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg
+ privileged: true
+ environment: &env
+ http_proxy: "{{ lookup('env', 'http_proxy') }}"
+ https_proxy: "{{ lookup('env', 'https_proxy') }}"
+ ulimits: &ulimit
+ - host
+ # vagrant ones
+ box: foo/bar
+ memory: 1024
+ cpus: 2
+ provider_raw_config_args: []
+ networks: # used by docker/podman
+ - name: foo
+
+ - name: ubi7
+ hostname: ubi7
+ children: ["ubi8"]
+ groups:
+ - ubi7
+ image: ubi7/ubi-init
+ registry:
+ url: registry.access.redhat.com
+ command: /sbin/init
+ tmpfs:
+ - /run
+ - /tmp
+ volumes:
+ - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
+ - /etc/pki/rpm-gpg:/etc/pki/rpm-gpg
+ - /sys/fs/cgroup:/sys/fs/cgroup:ro
+ network_mode: service:vpn
+ privileged: true
+ environment: &env
+ http_proxy: "{{ lookup('env', 'http_proxy') }}"
+ https_proxy: "{{ lookup('env', 'https_proxy') }}"
+ ulimits: &ulimit
+ - host
+
+provisioner:
+ playbooks:
+ prepare: prepare.yml
+ inventory:
+ hosts:
+ all:
+ hosts:
+ ubi8:
+ ansible_python_interpreter: /usr/bin/python3
+ ubi7:
+ selinux: permissive
+ ubi8:
+ selinux: enforced
+ name: ansible
+ log: true
+ env:
+ ANSIBLE_STDOUT_CALLBACK: yaml
+ config_options:
+ defaults:
+ fact_caching: jsonfile
+ fact_caching_connection: /tmp/molecule/facts
+
+scenario:
+ test_sequence:
+ - destroy
+ - create
+ - prepare
+ - converge
+ - check
+ - verify
+ - destroy
+
+verifier:
+ name: testinfra
diff --git a/test/schemas/test/molecule/vagrant/molecule.yml b/test/schemas/test/molecule/vagrant/molecule.yml
new file mode 100644
index 0000000..dea2c07
--- /dev/null
+++ b/test/schemas/test/molecule/vagrant/molecule.yml
@@ -0,0 +1,46 @@
+---
+dependency:
+ name: shell
+ enabled: false
+
+lint: |
+ set -e
+ yamllint .
+ ansible-lint
+
+driver:
+ name: vagrant
+ provider:
+ name: libvirt
+ provision: false
+ cachier: machine
+ parallel: true
+ default_box: "generic/alpine310"
+platforms:
+ - name: instance
+ hostname: foo.bar.com
+ interfaces:
+ - auto_config: true
+ network_name: private_network
+ type: dhcp
+ instance_raw_config_args:
+ - 'vm.synced_folder ".", "/vagrant", type: "rsync"'
+ - 'vm.provision :shell, inline: "uname"'
+ config_options:
+ ssh.keep_alive: true
+ ssh.remote_user: "vagrant"
+ synced_folder: true
+ box: fedora/32-cloud-base
+ box_version: 32.20200422.0
+ box_url: "http://127.0.0.1/box.img"
+ memory: 512
+ cpus: 1
+ provider_options:
+ video_type: "vga"
+ provider_raw_config_args:
+ - cpuset = '1-4,^3,6'
+ - name: instance2
+ hostname: false
+
+provisioner:
+ name: ansible
diff --git a/test/schemas/test/playbooks/block.yml b/test/schemas/test/playbooks/block.yml
new file mode 100644
index 0000000..631242b
--- /dev/null
+++ b/test/schemas/test/playbooks/block.yml
@@ -0,0 +1,10 @@
+- hosts: localhost
+ tasks:
+ - debug:
+ msg: task under no block
+ - block:
+ - debug:
+ msg: task under one level of block
+ - block:
+ - debug:
+ msg: task under two levels of block
diff --git a/test/schemas/test/playbooks/defaults/foo.yml b/test/schemas/test/playbooks/defaults/foo.yml
new file mode 100644
index 0000000..47d9438
--- /dev/null
+++ b/test/schemas/test/playbooks/defaults/foo.yml
@@ -0,0 +1,3 @@
+# defaults have same format as vars
+in_is_reserved: ...
+ss: ss
diff --git a/test/schemas/test/playbooks/environment.yml b/test/schemas/test/playbooks/environment.yml
new file mode 100644
index 0000000..d25fd1b
--- /dev/null
+++ b/test/schemas/test/playbooks/environment.yml
@@ -0,0 +1,7 @@
+---
+- hosts: localhost
+ environment: # <- valid
+ FOO: BAR
+
+- hosts: localhost
+ environment: "{{ foo }}" # <- valid
diff --git a/test/schemas/test/playbooks/failed_when.yml b/test/schemas/test/playbooks/failed_when.yml
new file mode 100644
index 0000000..14c942a
--- /dev/null
+++ b/test/schemas/test/playbooks/failed_when.yml
@@ -0,0 +1,18 @@
+- hosts: localhost
+ tasks:
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ failed_when: false # <- valid
+
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ failed_when: "string is valid too" # <- valid
+
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ failed_when: # <- lists are valid too
+ - foo
+ - bar
diff --git a/test/schemas/test/playbooks/full-jinja.yml b/test/schemas/test/playbooks/full-jinja.yml
new file mode 100644
index 0000000..22eaafe
--- /dev/null
+++ b/test/schemas/test/playbooks/full-jinja.yml
@@ -0,0 +1,16 @@
+---
+- name: Test that schema allows multiline-jinja
+ hosts: localhost
+ # https://github.com/ansible/ansible-lint/issues/2772
+ become: >-
+ {{
+ true
+ }}
+ tasks:
+ - name: Test more complex jinja is also allowed
+ ansible.builtin.debug:
+ msg: "{{ item }}"
+ # that below is valid and show be allowed:
+ with_items: >-
+ {%- set ns = [1, 1, 2] -%}
+ {{- ns | unique -}}
diff --git a/test/schemas/test/playbooks/gather_facts.yml b/test/schemas/test/playbooks/gather_facts.yml
new file mode 100644
index 0000000..598188d
--- /dev/null
+++ b/test/schemas/test/playbooks/gather_facts.yml
@@ -0,0 +1,6 @@
+---
+- hosts: localhost
+ gather_facts: false
+ tasks:
+ - ansible.builtin.debug:
+ msg: foo
diff --git a/test/schemas/test/playbooks/gather_subset.yml b/test/schemas/test/playbooks/gather_subset.yml
new file mode 100644
index 0000000..de0e689
--- /dev/null
+++ b/test/schemas/test/playbooks/gather_subset.yml
@@ -0,0 +1,15 @@
+---
+- hosts: localhost
+ gather_subset:
+ - all
+ - "!network"
+ tasks:
+ - ansible.builtin.debug:
+ msg: foo
+
+- hosts: localhost
+ gather_subset:
+ - all
+ tasks:
+ - ansible.builtin.debug:
+ msg: bar
diff --git a/test/schemas/test/playbooks/ignore_errors..yml b/test/schemas/test/playbooks/ignore_errors..yml
new file mode 100644
index 0000000..6c92046
--- /dev/null
+++ b/test/schemas/test/playbooks/ignore_errors..yml
@@ -0,0 +1,9 @@
+- hosts: localhost
+ tasks:
+ - command: echo 123
+ ignore_errors: true
+
+ - command: echo 123
+ vars:
+ should_ignore_errors: true
+ ignore_errors: "{{ should_ignore_errors }}"
diff --git a/test/schemas/test/playbooks/import_playbook.yml b/test/schemas/test/playbooks/import_playbook.yml
new file mode 100644
index 0000000..efd8787
--- /dev/null
+++ b/test/schemas/test/playbooks/import_playbook.yml
@@ -0,0 +1,9 @@
+- ansible.builtin.import_playbook: other.yml
+
+- import_playbook: other.yml
+ tags:
+ - foo
+
+- import_playbook: other.yml
+ when:
+ - foo is true
diff --git a/test/schemas/test/playbooks/included.yml b/test/schemas/test/playbooks/included.yml
new file mode 100644
index 0000000..468a17c
--- /dev/null
+++ b/test/schemas/test/playbooks/included.yml
@@ -0,0 +1 @@
+- hosts: localhost
diff --git a/test/schemas/test/playbooks/integers.yml b/test/schemas/test/playbooks/integers.yml
new file mode 100644
index 0000000..861acee
--- /dev/null
+++ b/test/schemas/test/playbooks/integers.yml
@@ -0,0 +1,23 @@
+---
+- hosts: localhost
+ vars:
+ some: 0
+ gather_timeout: "{{ some }}"
+ tasks:
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ async: 0
+ poll: 0
+ delay: 0
+ timeout: 0
+ port: 0
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ async: "{{ some }}"
+ poll: "{{ some }}"
+ delay: "{{ some }}"
+ timeout: "{{ some }}"
+ port: "{{ some }}"
+
+- hosts: localhost
+ gather_timeout: 0
diff --git a/test/schemas/test/playbooks/local_action_dict.yml b/test/schemas/test/playbooks/local_action_dict.yml
new file mode 100644
index 0000000..05b3129
--- /dev/null
+++ b/test/schemas/test/playbooks/local_action_dict.yml
@@ -0,0 +1,5 @@
+- hosts: localhost
+ tasks:
+ - local_action:
+ module: ansible.builtin.debug
+ msg: hello
diff --git a/test/schemas/test/playbooks/local_action_string.yml b/test/schemas/test/playbooks/local_action_string.yml
new file mode 100644
index 0000000..e7dacc4
--- /dev/null
+++ b/test/schemas/test/playbooks/local_action_string.yml
@@ -0,0 +1,3 @@
+- hosts: localhost
+ tasks:
+ - local_action: "ansible.builtin.debug msg=hello"
diff --git a/test/schemas/test/playbooks/loop.yml b/test/schemas/test/playbooks/loop.yml
new file mode 100644
index 0000000..c0e1734
--- /dev/null
+++ b/test/schemas/test/playbooks/loop.yml
@@ -0,0 +1,9 @@
+---
+- hosts: localhost
+ tasks:
+ - name: that should pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - foo
+ - bar
diff --git a/test/schemas/test/playbooks/no_log.yml b/test/schemas/test/playbooks/no_log.yml
new file mode 100644
index 0000000..e1944dd
--- /dev/null
+++ b/test/schemas/test/playbooks/no_log.yml
@@ -0,0 +1,11 @@
+- hosts: localhost
+ vars:
+ some_var: true
+ tasks:
+ - ansible.builtin.debug:
+ msg: foo
+ no_log: true
+
+ - ansible.builtin.debug:
+ msg: foo
+ no_log: "{{ some_var }}"
diff --git a/test/schemas/test/playbooks/roles.yml b/test/schemas/test/playbooks/roles.yml
new file mode 100644
index 0000000..a996ce0
--- /dev/null
+++ b/test/schemas/test/playbooks/roles.yml
@@ -0,0 +1,13 @@
+- hosts: localhost
+ roles: []
+
+- hosts: localhost
+ roles:
+ - foo
+ - role: "path/to/role"
+ vars:
+ FOO: bar
+ tags:
+ - foo
+ - role: bar
+ tags: string_tag
diff --git a/test/schemas/test/playbooks/run.yml b/test/schemas/test/playbooks/run.yml
new file mode 100644
index 0000000..52e7001
--- /dev/null
+++ b/test/schemas/test/playbooks/run.yml
@@ -0,0 +1,42 @@
+- name: foo
+ ansible.builtin.import_playbook: included.yml
+
+- hosts: # to check if lists are allowed:
+ - localhost
+ - webservers
+ # validate serial allows strings like percentage value
+ serial: 10%
+ handlers:
+ - name: handler 1
+ ansible.builtin.debug:
+ msg: "I am handler 1"
+ listen: "always handler"
+
+ - name: handler 2
+ ansible.builtin.debug:
+ msg: "I am handler 2"
+ listen: # to check if lists are allowed:
+ - "list listening handler"
+ - "other listening topic"
+
+- hosts: localhost
+ serial: 1 # validate serial allows integer
+
+- hosts: localhost
+ serial: "{{ 1 }}" # jinja also ok
+
+- hosts: localhost
+ serial: # validate serial allows these too:
+ - 123
+ - 10%
+ - "{{ some }}" # jinja also ok
+
+- hosts: localhost
+ tasks:
+ - debug:
+ msg: "failed_when should accept booleans"
+ failed_when: false
+
+ - debug:
+ msg: "failed_when should allow strings"
+ failed_when: "'foo' in 'foobar'"
diff --git a/test/schemas/test/playbooks/run_once.yml b/test/schemas/test/playbooks/run_once.yml
new file mode 100644
index 0000000..be36c8e
--- /dev/null
+++ b/test/schemas/test/playbooks/run_once.yml
@@ -0,0 +1,6 @@
+- hosts: localhost
+ tasks:
+ - name: foo2
+ ansible.builtin.debug:
+ msg: foo!
+ run_once: "{{ true }}" # valid
diff --git a/test/schemas/test/playbooks/tags.yml b/test/schemas/test/playbooks/tags.yml
new file mode 100644
index 0000000..b758257
--- /dev/null
+++ b/test/schemas/test/playbooks/tags.yml
@@ -0,0 +1,23 @@
+- hosts: localhost
+ roles:
+ - role: foo
+ tags: foo # <-- allowed
+ - role: foo
+ tags: # <-- allowed
+ - foo
+ - bar
+ tags: # <-- allowed
+ - foo
+ - bar
+ tasks:
+ - ansible.builtin.debug:
+ msg: "..."
+ tags: # <-- allowed
+ - foo
+ - bar
+ - ansible.builtin.debug:
+ msg: "..."
+ tags: # <-- allowed
+ - foo
+- hosts: localhost
+ tags: foo # <-- allowed
diff --git a/test/schemas/test/playbooks/tasks.yml b/test/schemas/test/playbooks/tasks.yml
new file mode 100644
index 0000000..b01cf8c
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks.yml
@@ -0,0 +1,5 @@
+- hosts: localhost
+ pre_tasks: []
+ post_tasks: []
+ tasks: []
+ handlers: []
diff --git a/test/schemas/test/playbooks/tasks/args.yml b/test/schemas/test/playbooks/tasks/args.yml
new file mode 100644
index 0000000..1e25e1d
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/args.yml
@@ -0,0 +1,4 @@
+- action: foo
+ args: {}
+- action: foo
+ args: "{{ {} }}"
diff --git a/test/schemas/test/playbooks/tasks/become_method.yml b/test/schemas/test/playbooks/tasks/become_method.yml
new file mode 100644
index 0000000..9d63a76
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/become_method.yml
@@ -0,0 +1,7 @@
+- command: echo 123
+ become_method: sudo
+
+- command: echo 123
+ vars:
+ sudo_var: doo
+ become_method: "{{ sudo_var }}" # templating is ok
diff --git a/test/schemas/test/playbooks/tasks/changed_when.yml b/test/schemas/test/playbooks/tasks/changed_when.yml
new file mode 100644
index 0000000..7887ac7
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/changed_when.yml
@@ -0,0 +1,10 @@
+- command: echo 123
+ changed_when: false
+
+- command: echo 123
+ changed_when: '"1" in ["1", "2", "3"]'
+
+- command: echo 123
+ changed_when: # valid, all items must evaluate as true (AND)
+ - "foo is defined"
+ - '"1" in ["1", "2", "3"]'
diff --git a/test/schemas/test/playbooks/tasks/diff.yml b/test/schemas/test/playbooks/tasks/diff.yml
new file mode 100644
index 0000000..cc0bebc
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/diff.yml
@@ -0,0 +1,4 @@
+- action: foo
+ diff: true
+- action: foo
+ diff: "{{ true }}"
diff --git a/test/schemas/test/playbooks/tasks/empty_tasks.yml b/test/schemas/test/playbooks/tasks/empty_tasks.yml
new file mode 100644
index 0000000..7ee1211
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/empty_tasks.yml
@@ -0,0 +1,2 @@
+---
+# this is a valid tasks file, loaded as 'null' document.
diff --git a/test/schemas/test/playbooks/tasks/ignore_errors.yml b/test/schemas/test/playbooks/tasks/ignore_errors.yml
new file mode 100644
index 0000000..2f253f2
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/ignore_errors.yml
@@ -0,0 +1,7 @@
+- command: echo 123
+ ignore_errors: true
+
+- command: echo 123
+ vars:
+ should_ignore_errors: true
+ ignore_errors: "{{ should_ignore_errors }}"
diff --git a/test/schemas/test/playbooks/tasks/local_action_dict.yml b/test/schemas/test/playbooks/tasks/local_action_dict.yml
new file mode 100644
index 0000000..5351ab9
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/local_action_dict.yml
@@ -0,0 +1,3 @@
+- local_action:
+ module: ansible.builtin.debug
+ msg: hello
diff --git a/test/schemas/test/playbooks/tasks/local_action_string.yml b/test/schemas/test/playbooks/tasks/local_action_string.yml
new file mode 100644
index 0000000..93d98e0
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/local_action_string.yml
@@ -0,0 +1 @@
+- local_action: "ansible.builtin.debug msg=hello"
diff --git a/test/schemas/test/playbooks/tasks/loop.yml b/test/schemas/test/playbooks/tasks/loop.yml
new file mode 100644
index 0000000..33c6130
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/loop.yml
@@ -0,0 +1,6 @@
+- name: that should pass
+ ansible.builtin.debug:
+ var: item
+ loop:
+ - foo
+ - bar
diff --git a/test/schemas/test/playbooks/tasks/no_log.yml b/test/schemas/test/playbooks/tasks/no_log.yml
new file mode 100644
index 0000000..83a12d0
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/no_log.yml
@@ -0,0 +1,11 @@
+- ansible.builtin.debug:
+ msg: foo
+ no_log: true # valid
+ vars:
+ some_var: true
+
+- ansible.builtin.debug:
+ msg: foo
+ no_log: "{{ some_var }}" # valid too
+ vars:
+ some_var: true
diff --git a/test/schemas/test/playbooks/tasks/notify.yml b/test/schemas/test/playbooks/tasks/notify.yml
new file mode 100644
index 0000000..88432d9
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/notify.yml
@@ -0,0 +1,11 @@
+- name: notify single handler
+ ansible.builtin.debug:
+ msg: task with single handler
+ notify: handler1
+
+- name: notify multiple handlers
+ ansible.builtin.debug:
+ msg: task with multiple handlers
+ notify:
+ - handler1
+ - handler2
diff --git a/test/schemas/test/playbooks/tasks/run_once.yml b/test/schemas/test/playbooks/tasks/run_once.yml
new file mode 100644
index 0000000..0f3f6f7
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/run_once.yml
@@ -0,0 +1,9 @@
+- name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ run_once: true # valid
+
+- name: foo2
+ ansible.builtin.debug:
+ msg: foo!
+ run_once: "{{ true }}" # valid
diff --git a/test/schemas/test/playbooks/tasks/some_tasks.yml b/test/schemas/test/playbooks/tasks/some_tasks.yml
new file mode 100644
index 0000000..2430d52
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/some_tasks.yml
@@ -0,0 +1,8 @@
+- name: foo
+ debug:
+ msg: bar
+ delegate_facts: true
+
+- block:
+ - debug:
+ msg: "block under one level of block"
diff --git a/test/schemas/test/playbooks/tasks/tags.yml b/test/schemas/test/playbooks/tasks/tags.yml
new file mode 100644
index 0000000..a0b7454
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/tags.yml
@@ -0,0 +1,29 @@
+- command: echo 123
+ tags:
+ - foo
+ - bar
+
+- command: echo 123
+ tags: foo
+
+- block:
+ - command: echo 123
+ tags:
+ - foo
+ - bar
+
+ - command: echo 123
+ tags: foo
+ tags:
+ - foo
+ - bar
+
+- block:
+ - command: echo 123
+ tags:
+ - foo
+ - bar
+
+ - command: echo 123
+ tags: foo
+ tags: foo
diff --git a/test/schemas/test/playbooks/tasks/templated_become.yml b/test/schemas/test/playbooks/tasks/templated_become.yml
new file mode 100644
index 0000000..a8cfad3
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/templated_become.yml
@@ -0,0 +1,12 @@
+- name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ become: "{{ firewalld_become }}" # <- valid
+
+- name: foo block
+ become: "{{ firewalld_become }}" # <- valid
+ block:
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ become: "{{ firewalld_become }}" # <- valid
diff --git a/test/schemas/test/playbooks/tasks/templated_integers.yml b/test/schemas/test/playbooks/tasks/templated_integers.yml
new file mode 100644
index 0000000..59c4530
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/templated_integers.yml
@@ -0,0 +1,5 @@
+- debug:
+ msg: foo
+ retries: "{{ 2 }}" # <-- valid
+ port: "{{ 80 }}" # <-- valid
+ poll: "{{ 2 }}" # <-- valid
diff --git a/test/schemas/test/playbooks/tasks/throttled.yml b/test/schemas/test/playbooks/tasks/throttled.yml
new file mode 100644
index 0000000..e1be471
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/throttled.yml
@@ -0,0 +1,5 @@
+- action: foo
+ throttle: 1 # valid
+
+- action: foo
+ throttle: "{{ 1 }}" # valid
diff --git a/test/schemas/test/playbooks/tasks/until.yml b/test/schemas/test/playbooks/tasks/until.yml
new file mode 100644
index 0000000..2146a9d
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/until.yml
@@ -0,0 +1,14 @@
+- ansible.builtin.debug:
+ msg: "valid"
+ until: true
+
+- ansible.builtin.debug:
+ msg: "valid"
+ until:
+ - "foo not in bar"
+
+- ansible.builtin.debug:
+ msg: "valid"
+ until:
+ - "'1' in ['1', '2', '3']"
+ - "foo is not defined"
diff --git a/test/schemas/test/playbooks/tasks/when.yml b/test/schemas/test/playbooks/tasks/when.yml
new file mode 100644
index 0000000..7874329
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/when.yml
@@ -0,0 +1,10 @@
+- action: foo
+ when: true # valid
+
+- action: foo 2
+ when: foo in bar # valid
+
+- action: foo 3
+ when: # valid
+ - foo in bar
+ - apple is orange
diff --git a/test/schemas/test/playbooks/tasks/with_items.yml b/test/schemas/test/playbooks/tasks/with_items.yml
new file mode 100644
index 0000000..07c72aa
--- /dev/null
+++ b/test/schemas/test/playbooks/tasks/with_items.yml
@@ -0,0 +1,16 @@
+- command: echo 123
+ with_items: []
+
+- command: echo 123
+ with_items:
+ - 1
+ - foo
+ - {}
+ - []
+
+- command: echo 123
+ vars:
+ my_list:
+ - 1
+ - 2
+ with_items: "{{ my_list }}"
diff --git a/test/schemas/test/playbooks/templated_become.yml b/test/schemas/test/playbooks/templated_become.yml
new file mode 100644
index 0000000..518e46b
--- /dev/null
+++ b/test/schemas/test/playbooks/templated_become.yml
@@ -0,0 +1,16 @@
+---
+- hosts: localhost
+ become: "{{ firewalld_become }}" # <- valid
+ tasks:
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ become: "{{ firewalld_become }}" # <- valid
+
+ - name: foo block
+ become: "{{ firewalld_become }}" # <- valid
+ block:
+ - name: foo
+ ansible.builtin.debug:
+ msg: foo!
+ become: "{{ firewalld_become }}" # <- valid
diff --git a/test/schemas/test/playbooks/user_valid.yml b/test/schemas/test/playbooks/user_valid.yml
new file mode 100644
index 0000000..bc6a5e6
--- /dev/null
+++ b/test/schemas/test/playbooks/user_valid.yml
@@ -0,0 +1,3 @@
+- hosts: localhost
+ user: foo # <-- allowed, alias to remote_user
+ tasks: []
diff --git a/test/schemas/test/playbooks/var_files.yml b/test/schemas/test/playbooks/var_files.yml
new file mode 100644
index 0000000..2630287
--- /dev/null
+++ b/test/schemas/test/playbooks/var_files.yml
@@ -0,0 +1,18 @@
+---
+- name: var_files should accept null
+ hosts: localhost
+ vars_files: null
+
+- name: var_files should accept string
+ hosts: localhost
+ vars_files: /dev/null
+
+- name: var_files should accept array[string]
+ hosts: localhost
+ vars_files:
+ - /dev/null
+
+- name: var_files should accept array of array[string]
+ hosts: localhost
+ vars_files:
+ - ["/dev/null"]
diff --git a/test/schemas/test/playbooks/vars/empty_vars.yml b/test/schemas/test/playbooks/vars/empty_vars.yml
new file mode 100644
index 0000000..a6e3ce7
--- /dev/null
+++ b/test/schemas/test/playbooks/vars/empty_vars.yml
@@ -0,0 +1,2 @@
+---
+# Ensure we allow empty var files, matching Ansible behavior
diff --git a/test/schemas/test/playbooks/vars/encrypted.yml b/test/schemas/test/playbooks/vars/encrypted.yml
new file mode 100644
index 0000000..7808fec
--- /dev/null
+++ b/test/schemas/test/playbooks/vars/encrypted.yml
@@ -0,0 +1,6 @@
+$ANSIBLE_VAULT;1.2;AES256;dev
+66373266323161346330626137613862653935343634366636353266323966363665636266363739
+6436363237626633653139636232663131613832336266310a323766643264306436306266663930
+66666238346132373766623932356530333165613835623863653837306130383065323138333034
+6265313861613761620a393663616265633637343534346533366437653839623239396366366330
+3165
diff --git a/test/schemas/test/playbooks/vars/myvars.yml b/test/schemas/test/playbooks/vars/myvars.yml
new file mode 100644
index 0000000..8698380
--- /dev/null
+++ b/test/schemas/test/playbooks/vars/myvars.yml
@@ -0,0 +1,9 @@
+foo: bar
+_foo: bar
+foo_var_xxx: "{{ sss }}"
+in_job: ...
+nested:
+ pear: fruit
+ apple: fruit
+sso_force_handlers: ...
+force_handlers_foo: ...
diff --git a/test/schemas/test/playbooks/vars_prompt.yml b/test/schemas/test/playbooks/vars_prompt.yml
new file mode 100644
index 0000000..1bf65c3
--- /dev/null
+++ b/test/schemas/test/playbooks/vars_prompt.yml
@@ -0,0 +1,11 @@
+- name: Fixture
+ hosts: localhost
+ vars_prompt:
+ - name: username
+ prompt: What is your username?
+ private: false
+ unsafe: false
+
+ - name: password
+ prompt: What is your password?
+ default: "secret"
diff --git a/test/schemas/test/playbooks/when.yml b/test/schemas/test/playbooks/when.yml
new file mode 100644
index 0000000..93b7781
--- /dev/null
+++ b/test/schemas/test/playbooks/when.yml
@@ -0,0 +1,11 @@
+---
+- name: Test for when (passing)
+ hosts: localhost
+ gather_facts: false
+ tasks:
+ - name: Testing for when is passed a list
+ ansible.builtin.debug:
+ msg: "this is ok"
+ when:
+ - true
+ - "foo"
diff --git a/test/schemas/test/playbooks/with_.yml b/test/schemas/test/playbooks/with_.yml
new file mode 100644
index 0000000..b3a3748
--- /dev/null
+++ b/test/schemas/test/playbooks/with_.yml
@@ -0,0 +1,34 @@
+---
+# https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#with-flattened
+- hosts: localhost
+ tasks:
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_list: [] # <-- valid
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_items: [] # <-- valid
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_indexed_items: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_together: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_dict: {}
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_sequence: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_subelements: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_nested: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_random_choice: []
+ - ansible.builtin.debug:
+ msg: "{{ item }}"
+ with_fileglob: []
diff --git a/test/schemas/test/reqs2/meta/requirements.yml b/test/schemas/test/reqs2/meta/requirements.yml
new file mode 100644
index 0000000..8d55085
--- /dev/null
+++ b/test/schemas/test/reqs2/meta/requirements.yml
@@ -0,0 +1,7 @@
+# https://docs.ansible.com/ansible/latest/galaxy/user_guide.html
+collections:
+ - doo.bar
+ - name: geerlingguy.php_roles
+ version: 0.9.3
+ source: https://galaxy.ansible.com
+roles: []
diff --git a/test/schemas/test/reqs4/meta/requirements.yml b/test/schemas/test/reqs4/meta/requirements.yml
new file mode 100644
index 0000000..8269128
--- /dev/null
+++ b/test/schemas/test/reqs4/meta/requirements.yml
@@ -0,0 +1,6 @@
+# requirements v1 format
+- src: https://github.com/bennojoy/nginx
+- src: git+http://bitbucket.org/willthames/git-ansible-galaxy
+ version: v1.4
+ scm: git
+- include: foo.yml
diff --git a/test/schemas/test/reqs5/meta/requirements.yml b/test/schemas/test/reqs5/meta/requirements.yml
new file mode 100644
index 0000000..cd99e3c
--- /dev/null
+++ b/test/schemas/test/reqs5/meta/requirements.yml
@@ -0,0 +1,3 @@
+# Collection without roles
+collections:
+ - name: kubernetes.core
diff --git a/test/schemas/test/roles/empty-meta/meta/main.yml b/test/schemas/test/roles/empty-meta/meta/main.yml
new file mode 100644
index 0000000..9b6fe15
--- /dev/null
+++ b/test/schemas/test/roles/empty-meta/meta/main.yml
@@ -0,0 +1 @@
+# this is meta file without any data, ansible-core accepts it
diff --git a/test/schemas/test/roles/foo/meta/argument_specs.yml b/test/schemas/test/roles/foo/meta/argument_specs.yml
new file mode 100644
index 0000000..c8d8c68
--- /dev/null
+++ b/test/schemas/test/roles/foo/meta/argument_specs.yml
@@ -0,0 +1,74 @@
+---
+# 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"
+ version_added: 1.2.3
+ author: Foobar Baz
+ options:
+ my_app_int:
+ type: "int"
+ required: false
+ default: 42
+ description: "The integer value, defaulting to 42."
+ no_log: false
+ version_added: 1.0.0
+
+ my_app_str:
+ type: "str"
+ required: true
+ description:
+ - The string value.
+ - Has some more text.
+ choices:
+ - foo
+ - bar
+ - baz
+
+ top_level:
+ type: dict
+ description: Contains more content.
+ options:
+ sub_option:
+ type: list
+ elements: int
+ description: A list of special integers.
+ choices:
+ - 1
+ - 2
+ - 3
+ - 123
+
+ seealso:
+ - module: community.foo.bar
+ - module: community.foo.baz
+ description: Baz bam!
+ - plugin: community.foo.bam
+ plugin_type: lookup
+ - plugin: community.foo.bar
+ plugin_type: lookup
+ description: A lookup plugin.
+ - ref: developer_guide
+ description: A link into the Ansible documentation.
+ - link: https://docs.ansible.com/
+ name: The Ansible documentation.
+ description: A link to the Ansible documentation.
+
+ alternate:
+ short_description: The alternate entry point for the my_app role.
+ author:
+ - Foobar Baz
+ - Bert Foo
+ options:
+ my_app_int:
+ type: "int"
+ required: false
+ default: 1024
+ description: "The integer value, defaulting to 1024."
+
+ third:
+ description:
+ - First paragraph.
+ - Second paragraph.
+ options: {}
diff --git a/test/schemas/test/roles/foo/meta/main.yml b/test/schemas/test/roles/foo/meta/main.yml
new file mode 100644
index 0000000..b84b10c
--- /dev/null
+++ b/test/schemas/test/roles/foo/meta/main.yml
@@ -0,0 +1,46 @@
+collections:
+ - foo.bar
+dependencies:
+ - name: ansible-role-foo
+ version: "1.0"
+ - name: ansible-role-bar
+ version: "1.0"
+ # 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: community.molecule
+
+ # 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 web server, where the role is packaged in a tar.gz
+ - src: https://some.webserver.example.com/files/master.tar.gz
+ name: http-role
+
+galaxy_info:
+ author: John Doe
+ company: foo
+ description: foo
+ license: MIT
+ min_ansible_version: "2.9"
+ # standalone: true
+ platforms:
+ - name: Alpine
+ versions:
+ - all
diff --git a/test/schemas/test/roles/foo/meta/runtime.yml b/test/schemas/test/roles/foo/meta/runtime.yml
new file mode 100644
index 0000000..561e446
--- /dev/null
+++ b/test/schemas/test/roles/foo/meta/runtime.yml
@@ -0,0 +1,39 @@
+# Based on https://docs.ansible.com/ansible/devel/dev_guide/developing_collections_structure.html#meta-directory
+requires_ansible: ">=2.10,<2.11"
+plugin_routing:
+ inventory:
+ kubevirt:
+ redirect: community.general.kubevirt
+ my_inventory:
+ tombstone:
+ removal_version: "2.0.0"
+ warning_text: my_inventory has been removed. Please use other_inventory instead.
+ modules:
+ my_module:
+ deprecation:
+ removal_date: "2021-11-30"
+ warning_text:
+ my_module will be removed in a future release of this collection. Use
+ another.collection.new_module instead.
+ redirect: another.collection.new_module
+ podman_image:
+ redirect: containers.podman.podman_image
+ module_utils:
+ ec2:
+ redirect: amazon.aws.ec2
+ util_dir.subdir.my_util:
+ redirect: namespace.name.my_util
+import_redirection:
+ ansible.module_utils.old_utility:
+ redirect: ansible_collections.namespace_name.collection_name.plugins.module_utils.new_location
+action_groups:
+ groupname:
+ # The special metadata dictionary. All action/module names should be strings.
+ - metadata:
+ extend_group:
+ - another.collection.groupname
+ - another_group
+ - my_action
+ another_group:
+ - my_module
+ - another.collection.another_module
diff --git a/test/schemas/test/roles/maximum/meta/main.yml b/test/schemas/test/roles/maximum/meta/main.yml
new file mode 100644
index 0000000..10c57b1
--- /dev/null
+++ b/test/schemas/test/roles/maximum/meta/main.yml
@@ -0,0 +1,20 @@
+allow_duplicates: true
+galaxy_info:
+ author: John Doe
+ standalone: true # v1 role meta (standalone)
+ description: maximum
+ min_ansible_version: "2.9"
+ company: foo
+ license: MIT
+ galaxy_tags: # ensure galaxy_tags is allowed
+ - database
+ platforms:
+ - name: Alpine
+ versions:
+ - all
+dependencies:
+ - role: foo
+ vars: {}
+ when:
+ - foo
+ - bar
diff --git a/test/schemas/test/roles/meta-tags/meta/main.yml b/test/schemas/test/roles/meta-tags/meta/main.yml
new file mode 100644
index 0000000..4abba23
--- /dev/null
+++ b/test/schemas/test/roles/meta-tags/meta/main.yml
@@ -0,0 +1,25 @@
+---
+# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#role-dependencies
+dependencies:
+ - role: foo
+ tags: fruit # simple string allowed
+ - role: bar
+ tags: # array of strings allowed
+ - apple
+ - orange
+ - role: requires_sudo
+ become: true
+ - role: role_with_condition
+ when: inventory_hostname == "foo"
+ - role: another_role
+ # https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#passing-different-parameters
+ something_that_counts_as_role_parameter: ...
+ vars:
+ "foo": bar
+galaxy_info:
+ author: John Doe
+ standalone: true
+ description: foo
+ license: MIT
+ min_ansible_version: "2.10"
+ platforms: []
diff --git a/test/schemas/test/roles/ns/meta/main.yml b/test/schemas/test/roles/ns/meta/main.yml
new file mode 100644
index 0000000..0ea558c
--- /dev/null
+++ b/test/schemas/test/roles/ns/meta/main.yml
@@ -0,0 +1,13 @@
+---
+galaxy_info:
+ author: John Doe
+ standalone: true
+ description: foo
+ min_ansible_version: "2.9"
+ namespace: foo_bar
+ company: foo
+ license: MIT
+ platforms:
+ - name: Alpine
+ versions:
+ - all
diff --git a/test/schemas/test/roles/v1_role/meta/main.yml b/test/schemas/test/roles/v1_role/meta/main.yml
new file mode 100644
index 0000000..a74eb47
--- /dev/null
+++ b/test/schemas/test/roles/v1_role/meta/main.yml
@@ -0,0 +1,12 @@
+---
+galaxy_info:
+ standalone: true
+ author: foo-bar # <-- that is a valid author name because is a valid github username
+ description: foo
+ min_ansible_version: "2.9"
+ company: foo
+ license: MIT
+ platforms:
+ - name: Alpine
+ versions:
+ - all
diff --git a/test/schemas/test/tests/integration/rom_role/meta/main.yml b/test/schemas/test/tests/integration/rom_role/meta/main.yml
new file mode 100644
index 0000000..c1409c4
--- /dev/null
+++ b/test/schemas/test/tests/integration/rom_role/meta/main.yml
@@ -0,0 +1,5 @@
+---
+dependencies: []
+galaxy_info:
+ standalone: false
+ description: foo