From 0a6779f6b7c8317e387662036440938f8f3b6b2a Mon Sep 17 00:00:00 2001 From: azrdev Date: Tue, 21 Nov 2023 16:24:07 +0100 Subject: [PATCH] docs: improve readability & scope of docs for ansible.builtin.assert (#82256) Co-authored-by: Jonathan Biegert --- lib/ansible/modules/assert.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/assert.py b/lib/ansible/modules/assert.py index 1b1590fb5e2..420044203cf 100644 --- a/lib/ansible/modules/assert.py +++ b/lib/ansible/modules/assert.py @@ -73,12 +73,17 @@ author: ''' EXAMPLES = r''' -- ansible.builtin.assert: { that: "ansible_os_family != 'RedHat'" } +- name: A single condition can be supplied as string instead of list + ansible.builtin.assert: + that: "ansible_os_family != 'RedHat'" -- ansible.builtin.assert: +- name: Use yaml multiline strings to ease escaping + ansible.builtin.assert: that: - "'foo' in some_command_result.stdout" - number_of_the_counting == 3 + - > + "reject" not in some_command_result.stderr - name: After version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message ansible.builtin.assert: