Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/expect -f
- log_file /tmp/ansible.log
- set timeout 120
- set playbook [lindex $argv 0]
- set host [lindex $argv 1]
- set username [lindex $argv 2]
- set password [lindex $argv 3]
- spawn /usr/bin/ansible-playbook $playbook -l $host -e 'ansible_user=$username' -k -K -vvvv
- expect "SSH password:"
- send $passwordn
- expect "SUDO password*"
- send $passwordn
- expect "$"
- send "exitn"
- spawn /usr/bin/ansible-playbook /etc/ansible/playbooks/my_playbook.yml -l the_host -e 'ansible_user=ansible_user' -k -K -vvvv
- Using /etc/ansible/ansible.cfg as config file
- SSH password:
- SUDO password[defaults to SSH password]:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement