Vagrant with Ansible provisioner asking for sudo password

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Vagrant with Ansible provisioner asking for sudo password

Chris Sattinger

I've set ask_sudo_pass false just about everywhere:

### Vagrantfile

  config.vm.provision :ansible do |ansible|
    ansible.playbook = "vagrant.yml"
    ansible.inventory_file = "hosts.ini"
    ansible.ask_sudo_pass = false
    ansible.sudo_user = "vagrant"
  end

  # also opened the local IP
  config.vm.network :private_network, ip: "192.168.33.10"


### ./ansible.cfg
  
ask_sudo_pass=False

running:

vagrant up
or 
vagrant provision

[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] Running provisioner: ansible...
sudo password:


although I'd like it not to ask for password, I try entering "vagrant" anyway. 

this fails:

PLAY [vagrant] *********************

GATHERING FACTS *********************
fatal: [vg] => ssh connection closed waiting for password prompt

TASK: [sshers group] *********************
FATAL: no hosts matched or all hosts have already failed -- aborting


PLAY RECAP *********************
vg                             : ok=0    changed=0    unreachable=1    failed=0


although I can ssh directly to the virtualbox as user:vagrant pwd:vagrant.

I've also tried just running ansible against this local IP (not using provisioning plugin) but I get the same demand for a sudo password and same authentication failure.

Thanks to anyone who might help !

Vagrant version 1.2.2
ansible 1.1



--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.