2014-09-26 01:01:01 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-03-06 23:25:59 +00:00
|
|
|
# Copyright: (c) 2012, Dag Wieers <dag@wieers.com>
|
Remove wildcard imports
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)
2017-07-28 05:55:24 +00:00
|
|
|
# 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
|
|
|
|
|
2017-08-16 03:16:38 +00:00
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
2017-03-14 16:07:22 +00:00
|
|
|
'status': ['stableinterface'],
|
|
|
|
'supported_by': 'core'}
|
|
|
|
|
2019-03-06 23:25:59 +00:00
|
|
|
DOCUMENTATION = r'''
|
2014-09-26 01:01:01 +00:00
|
|
|
---
|
|
|
|
module: fail
|
|
|
|
short_description: Fail with custom message
|
|
|
|
description:
|
2019-03-06 23:25:59 +00:00
|
|
|
- This module fails the progress with a custom message.
|
|
|
|
- It can be useful for bailing out when a certain condition is met using C(when).
|
|
|
|
- This module is also supported for Windows targets.
|
2014-09-26 01:01:01 +00:00
|
|
|
version_added: "0.8"
|
|
|
|
options:
|
|
|
|
msg:
|
|
|
|
description:
|
2019-03-06 23:25:59 +00:00
|
|
|
- The customized message used for failing execution.
|
|
|
|
- If omitted, fail will simply bail out with a generic message.
|
|
|
|
type: str
|
|
|
|
default: Failed as requested from task
|
2017-06-26 15:26:53 +00:00
|
|
|
notes:
|
|
|
|
- This module is also supported for Windows targets.
|
2019-03-06 23:25:59 +00:00
|
|
|
seealso:
|
|
|
|
- module: assert
|
|
|
|
- module: debug
|
|
|
|
- module: meta
|
|
|
|
author:
|
|
|
|
- Dag Wieers (@dagwieers)
|
2014-09-26 01:01:01 +00:00
|
|
|
'''
|
|
|
|
|
2019-03-06 23:25:59 +00:00
|
|
|
EXAMPLES = r'''
|
2014-09-26 01:01:01 +00:00
|
|
|
# Example playbook using fail and when together
|
2016-11-15 20:21:47 +00:00
|
|
|
- fail:
|
2019-03-06 23:25:59 +00:00
|
|
|
msg: The system may not be provisioned according to the CMDB status.
|
2014-09-26 01:01:01 +00:00
|
|
|
when: cmdb_status != "to-be-staged"
|
|
|
|
'''
|