PATH:
usr
/
lib
/
python3.9
/
site-packages
/
ansible
/
modules
# -*- coding: utf-8 -*- # Copyright: (c) 2012, Dag Wieers <dag@wieers.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: assert short_description: Asserts given expressions are true description: - This module asserts that given expressions are true with an optional custom message. - This module is also supported for Windows targets. version_added: "1.5" options: that: description: - A list of string expressions of the same form that can be passed to the 'when' statement. type: list elements: str required: true fail_msg: description: - The customized message used for a failing assertion. - This argument was called 'msg' before Ansible 2.7, now it is renamed to 'fail_msg' with alias 'msg'. type: str aliases: [ msg ] version_added: "2.7" success_msg: description: - The customized message used for a successful assertion. type: str version_added: "2.7" quiet: description: - Set this to C(true) to avoid verbose output. type: bool default: no version_added: "2.8" extends_documentation_fragment: - action_common_attributes - action_common_attributes.conn - action_common_attributes.flow attributes: action: support: full async: support: none become: support: none bypass_host_loop: support: none connection: support: none check_mode: support: full delegation: support: none details: Aside from C(register) and/or in combination with C(delegate_facts), it has little effect. diff_mode: support: none platform: platforms: all seealso: - module: ansible.builtin.debug - module: ansible.builtin.fail - module: ansible.builtin.meta author: - Ansible Core Team - Michael DeHaan ''' EXAMPLES = r''' - ansible.builtin.assert: { that: "ansible_os_family != 'RedHat'" } - ansible.builtin.assert: that: - "'foo' in some_command_result.stdout" - number_of_the_counting == 3 - name: After version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message ansible.builtin.assert: that: - my_param <= 100 - my_param >= 0 fail_msg: "'my_param' must be between 0 and 100" success_msg: "'my_param' is between 0 and 100" - name: Please use 'msg' when ansible version is smaller than 2.7 ansible.builtin.assert: that: - my_param <= 100 - my_param >= 0 msg: "'my_param' must be between 0 and 100" - name: Use quiet to avoid verbose output ansible.builtin.assert: that: - my_param <= 100 - my_param >= 0 quiet: true '''
[-] getent.py
[edit]
[-] pause.py
[edit]
[-] iptables.py
[edit]
[+]
__pycache__
[-] import_playbook.py
[edit]
[-] stat.py
[edit]
[-] copy.py
[edit]
[-] slurp.py
[edit]
[-] service_facts.py
[edit]
[-] fetch.py
[edit]
[-] tempfile.py
[edit]
[-] pip.py
[edit]
[-] yum_repository.py
[edit]
[-] _include.py
[edit]
[-] assemble.py
[edit]
[-] user.py
[edit]
[-] sysvinit.py
[edit]
[-] lineinfile.py
[edit]
[-] find.py
[edit]
[-] replace.py
[edit]
[-] blockinfile.py
[edit]
[-] meta.py
[edit]
[-] hostname.py
[edit]
[-] reboot.py
[edit]
[-] shell.py
[edit]
[-] uri.py
[edit]
[-] script.py
[edit]
[-] async_status.py
[edit]
[-] include_vars.py
[edit]
[-] apt_repository.py
[edit]
[-] ping.py
[edit]
[-] expect.py
[edit]
[-] import_tasks.py
[edit]
[-] known_hosts.py
[edit]
[-] include_role.py
[edit]
[-] apt_key.py
[edit]
[-] apt.py
[edit]
[-] command.py
[edit]
[-] assert.py
[edit]
[-] subversion.py
[edit]
[-] cron.py
[edit]
[-] validate_argument_spec.py
[edit]
[-] wait_for.py
[edit]
[-] wait_for_connection.py
[edit]
[-] package.py
[edit]
[-] systemd.py
[edit]
[-] get_url.py
[edit]
[-] import_role.py
[edit]
[-] set_fact.py
[edit]
[-] group_by.py
[edit]
[-] yum.py
[edit]
[-] set_stats.py
[edit]
[-] dpkg_selections.py
[edit]
[-] add_host.py
[edit]
[-] fail.py
[edit]
[-] debug.py
[edit]
[-] debconf.py
[edit]
[-] setup.py
[edit]
[-] rpm_key.py
[edit]
[-] service.py
[edit]
[-] gather_facts.py
[edit]
[-] git.py
[edit]
[-] unarchive.py
[edit]
[-] include_tasks.py
[edit]
[+]
..
[-] async_wrapper.py
[edit]
[-] systemd_service.py
[edit]
[-] template.py
[edit]
[-] package_facts.py
[edit]
[-] raw.py
[edit]
[-] group.py
[edit]
[-] dnf.py
[edit]
[-] __init__.py
[edit]
[-] file.py
[edit]