我有一个可以通过 ssh 进入的 DataDomain 系统。我需要在 DataDomain 上自动执行一个过程,该过程在命令后提出一个问题:
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
我确实尝试使用 Ansible 并使用原始模块
- name: add dev3 active tier
raw: storage add tier active dev3
register: RESULT
这是失败的:
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.", ""]}
以下 ansible-playbook 也失败了:
- name: add dev3 active tier
raw: |
yes | storage add tier active dev3
register: RESULT
期望模块不接受原始并且也失败了。
- 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
知道如何回答问题并回答“是”吗?