expect
Collection: builtin
Full Name: parallax.builtin.expect
Aliases: ansible.builtin.expect, expect
Synopsis
Run a command and answer its interactive prompts
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| command | string | yes | The command module takes command to run | |
| responses | map | yes | Mapping of expected string/regex and string to respond with | |
| timeout | int | 30 | Amount of time in seconds to wait for the expected strings | |
| creates | string | A filename, when it already exists, this step will not be run | ||
| removes | string | A filename, when it does not exist, this step will not be run | ||
| chdir | string | Change directory before running command | ||
| echo | bool | false | Whether or not to echo out your response strings |
Example
- name: Drive an interactive installer
expect:
command: /opt/vendor/install.sh
responses:
"Accept licence": "yes"
"Install path": /opt/vendor
timeout: 300