我有一个运行密码加密密码工具的任务。
tags: encrypting
command: sh {{ansible_env.HOME}}/wso2/apim/{{item}}/wso2am-2.6.0/bin/ciphertool.sh -Dconfigure
with_sequence: start=1 end={{ no_of_nodes }}
此任务需要密码。但是失败,因为没有提供提示密码来发送密码。如何解决这个问题?
command
提供密码- name: Case insensitive password string match
expect:
command: passwd username
responses:
(?i)password: "MySekretPa$$word"
# you don't want to show passwords in your logs
no_log: true
根据您的情况,该任务可能与此任务相似。使password
提示适合您的需求
- expect: command: sh {{ansible_env.HOME}}/wso2/apim/{{item}}/wso2am-2.6.0/bin/ciphertool.sh -Dconfigure responses: (?i)password: "MySekretPassword" loop: "{{ range(1, no_of_nodes)|list }}" no_log: true tags: encrypting