mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Made the following changes: * Removed wildcard imports * Replaced long form of GPL header with short form * Removed get_exception usage * Added from __future__ boilerplate * Adjust division operator to // where necessary For the following files: * web_infrastructure modules * system modules * linode, lxc, lxd, atomic, cloudscale, dimensiondata, ovh, packet, profitbricks, pubnub, smartos, softlayer, univention modules * compat dirs (disabled as its used intentionally)
53 lines
1.4 KiB
Python
53 lines
1.4 KiB
Python
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright 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
|
|
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
|
'status': ['stableinterface'],
|
|
'supported_by': 'core'}
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
---
|
|
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 string expression of the same form that can be passed to the 'when' statement"
|
|
- "Alternatively, a list of string expressions"
|
|
required: true
|
|
msg:
|
|
description:
|
|
- "The customized message used for a failing assertion"
|
|
notes:
|
|
- This module is also supported for Windows targets.
|
|
author:
|
|
- "Ansible Core Team"
|
|
- "Michael DeHaan"
|
|
'''
|
|
|
|
EXAMPLES = '''
|
|
- assert: { that: "ansible_os_family != 'RedHat'" }
|
|
|
|
- assert:
|
|
that:
|
|
- "'foo' in some_command_result.stdout"
|
|
- "number_of_the_counting == 3"
|
|
|
|
- assert:
|
|
that:
|
|
- "my_param <= 100"
|
|
- "my_param >= 0"
|
|
msg: "'my_param' must be between 0 and 100"
|
|
'''
|