2018-07-27 10:01:50 +02:00
|
|
|
- hosts: alpine
|
|
|
|
gather_facts: no
|
|
|
|
vars_files:
|
|
|
|
- "{{ playbook_dir }}/../test/myVault.yml"
|
|
|
|
vars:
|
|
|
|
- module: pexpect
|
|
|
|
- file: "{{ playbook_dir }}/scripts/input_script.sh"
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- include_tasks: tasks/pip_module_present.yml
|
|
|
|
- include_tasks: tasks/copy_file_to_tmp.yml
|
|
|
|
- name: Input test
|
|
|
|
expect:
|
|
|
|
command: /bin/ash /tmp/input_script.sh
|
|
|
|
responses:
|
|
|
|
(?i)user: "{{ user }}"
|
|
|
|
(?i)password: "{{ password }}"
|
2018-07-27 11:50:05 +02:00
|
|
|
register: output
|
2018-07-27 11:50:56 +02:00
|
|
|
- name: Print output
|
2018-07-27 11:52:30 +02:00
|
|
|
debug:
|
2018-07-27 11:53:32 +02:00
|
|
|
var: output.stdout
|