diff --git a/lib/ansible/modules/expect.py b/lib/ansible/modules/expect.py index 7025ed32369..75525fed44d 100644 --- a/lib/ansible/modules/expect.py +++ b/lib/ansible/modules/expect.py @@ -105,6 +105,17 @@ EXAMPLES = r''' - response1 - response2 - response3 + +- name: Multiple questions with responses + ansible.builtin.expect: + command: /path/to/custom/command + responses: + "Please provide your name": + - "Anna" + "Database user": + - "{{ db_username }}" + "Database password": + - "{{ db_password }}" ''' import datetime