Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何在執行 ansible-playbook 時,自動輸入 sudo 密碼? #17

Closed
chusiang opened this issue Apr 21, 2017 · 0 comments
Closed
Assignees

Comments

@chusiang
Copy link
Member

若遇到不能使用 ssh key 操作 Ansible 時,我們可搭配 Valut 來使用,可用了 ansible_ssh_pass 儲存 ssh password 後,還是有機會遇到需輸入 sudo password 的問題,這時只需再設一個 ansible_sudo_pass 即可。

$ cat lab.hosts
[lab]
lab1.example.tw   ansible_host=192.168.100.1  ansible_ssh_pass=SUDO_PASSWORD
lab2.example.tw   ansible_host=192.168.100.2  ansible_ssh_pass=SUDO_PASSWORD

[lab:vars]
ansible_sudo_pass=SUDO_PASSWORD

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant