summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-args-module-fail.yml
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/playbooks/rule-args-module-fail.yml
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/playbooks/rule-args-module-fail.yml')
-rw-r--r--examples/playbooks/rule-args-module-fail.yml37
1 files changed, 37 insertions, 0 deletions
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"