2014-09-26 01:01:01 +00:00
# -*- mode: python -*-
2015-07-04 03:57:53 +00:00
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
2016-12-06 10:35:05 +00:00
ANSIBLE_METADATA = { ' status ' : [ ' stableinterface ' ] ,
' supported_by ' : ' core ' ,
' version ' : ' 1.0 ' }
2014-09-26 01:01:01 +00:00
DOCUMENTATION = '''
- - -
module : pause
short_description : Pause playbook execution
description :
- Pauses playbook execution for a set amount of time , or until a prompt is acknowledged . All parameters are optional . The default behavior is to pause with a prompt .
- " You can use C(ctrl+c) if you wish to advance a pause earlier than it is set to expire or if you need to abort a playbook run entirely. To continue early: press C(ctrl+c) and then C(c). To abort a playbook: press C(ctrl+c) and then C(a). "
- " The pause module integrates into async/parallelized playbooks without any special considerations (see also: Rolling Updates). When using pauses with the C(serial) playbook parameter (as in rolling updates) you are only prompted once for the current group of hosts. "
version_added : " 0.8 "
options :
minutes :
description :
2016-06-27 13:35:26 +00:00
- A positive number of minutes to pause for .
2014-09-26 01:01:01 +00:00
required : false
default : null
seconds :
description :
2016-06-27 13:35:26 +00:00
- A positive number of seconds to pause for .
2014-09-26 01:01:01 +00:00
required : false
default : null
prompt :
description :
- Optional text to use for the prompt message .
required : false
default : null
2015-06-15 19:53:30 +00:00
author : " Tim Bielawa (@tbielawa) "
2016-06-27 13:35:26 +00:00
notes :
- Starting in 2.2 , if you specify 0 or negative for minutes or seconds , it will wait for 1 second , previously it would wait indefinitely .
2014-09-26 01:01:01 +00:00
'''
EXAMPLES = '''
# Pause for 5 minutes to build app cache.
2016-11-15 20:21:47 +00:00
- pause :
minutes : 5
2014-09-26 01:01:01 +00:00
# Pause until you can verify updates to an application were successful.
- pause :
# A helpful reminder of what to look out for post-update.
2016-11-15 20:21:47 +00:00
- pause :
prompt : " Make sure org.foo.FooOverload exception is not present "
2014-09-26 01:01:01 +00:00
'''
2017-02-23 16:30:09 +00:00
RETURN = '''
user_input :
description : User input from interactive console
returned : if no waiting time set
type : string
sample : Example user input
start :
description : Time when started pausing
returned : always
type : string
sample : 2017 - 02 - 23 14 : 35 : 07.298862
stop :
description : Time when ended pausing
returned : always
type : string
sample : 2017 - 02 - 23 14 : 35 : 09.552594
delta :
description : Time paused in seconds
returned : always
type : string
sample : 2
stdout :
description : Output of pause module
returned : always
type : string
sample : Paused for 0.04 minutes
'''