I have a DataDomain System which I can enter via ssh. I need to automate a procedure on the DataDomain which does aks a question after a command:
storage add tier active dev3
Object-store is not enabled. Filesystem will use block storage for user data.
Do you want to continue? (yes|no) [no]: yes
I do try this with Ansible and do use the raw module
- name: add dev3 active tier
raw: storage add tier active dev3
register: RESULT
This is failing with:
TASK [add dev3 active tier] *******************************************************************************************************************************************************************
fatal: [3.127.218.96]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 9, "stderr": "Shared connection to 3.127.218.96 closed.\r\n", "stderr_lines": ["Shared connection to 3.127.218.96 closed."], "stdout": "\r\n**** Could not add storage: system capacity exceeds the limit allowable by the license.\r\n\r\n", "stdout_lines": ["", "**** Could not add storage: system capacity exceeds the limit allowable by the license.", ""]}
the following ansible-playbook is also failing with:
- name: add dev3 active tier
raw: |
yes | storage add tier active dev3
register: RESULT
expect module does not accept raw and is also failing.
- name expect for add dev3 active tier
expect:
raw: storage add tier active dev3
responses:
Question:
- Do you want to continue? (yes|no) [no]: y
timeout: 30
register: RESULT
Any idea how I can catch the question and answer with yes?