ansible.builtin.pause (v2.3.0.0-1) — module

Pause playbook execution

| "added in version" 0.8 of ansible.builtin"

Authors: Tim Bielawa (@tbielawa)

stableinterface | supported by core

Install Ansible via pip

Install with pip install ansible==2.3.0.0.post1

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Pause for 5 minutes to build app cache.
- pause:
    minutes: 5
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Pause until you can verify updates to an application were successful.
- pause:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# A helpful reminder of what to look out for post-update.
- pause:
    prompt: "Make sure org.foo.FooOverload exception is not present"

Inputs

    
prompt:
    default: null
    description:
    - Optional text to use for the prompt message.
    required: false

minutes:
    default: null
    description:
    - A positive number of minutes to pause for.
    required: false

seconds:
    default: null
    description:
    - A positive number of seconds to pause for.
    required: false

Outputs

delta:
  description: Time paused in seconds
  returned: always
  sample: 2
  type: string
start:
  description: Time when started pausing
  returned: always
  sample: '2017-02-23T14:35:07.298862'
  type: string
stdout:
  description: Output of pause module
  returned: always
  sample: Paused for 0.04 minutes
  type: string
stop:
  description: Time when ended pausing
  returned: always
  sample: '2017-02-23T14:35:09.552594'
  type: string
user_input:
  description: User input from interactive console
  returned: if no waiting time set
  sample: Example user input
  type: string