Invalid 2.1.2 playbook passes SSH password and sudo password as args command line

I looked around, but could not find a suitable solution, I want to run a playbook for several users on multiple hosts, and my roles use user information such as name, email address, identifier ... Now instead of launching a playbook for each user, I wrote a python script that calls ansible

ansible-playbook -i hosts --ask-become-pass --ask-pass ./playbooks/myplaybook.yml 

But to execute the above command, I want to pass the SSH password and the SUDO password as arguments to the command. I checked the downloadable documentation but could not find it. What would be the best way to achieve this?

+8
source share
1 answer

You can specify the following parameters on the command line:

 … -e "ansible_user=username ansible_ssh_pass=xxx ansible_sudo_pass=xxx" … 
+10
source

Source: https://habr.com/ru/post/1263115/


All Articles