我正在学习 Ansible,我想知道如何编写一个任务来处理以下命令:
$<command> <options>
username:
email address:
password:
password (check):
The <command> <option>
需要四个可以在剧本中硬编码的变量。
感谢您提供的任何见解
Use expect https://docs.ansible.com/ansible/latest/collections/ansible/builtin/expect_module.html module:
- hosts: localhost
tasks:
- expect:
command: command option
responses:
username: "John Doe"
email: "[email protected] /cdn-cgi/l/email-protection"
password: "mypass"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)