On paź 31, Hartmut Goebel wrote:
I'm using debops and lxc on vagrant-manages boxes. The
"vagrant ansible
integration" plugin (vai) enables accessing the machines and by passing some
variables for the containers I can access the containers.
Anyhow, lxc_ssh requires to execute lxc-attach as root.
Thus I"m seeking either
1) How to make lxc_ssh support ‘become’?
I'm not sure if that's possible to be implemented in lxc_ssh plugin itself.
Become in Ansible is solved by Ansible executing a Python script through
'sudo' transparently, so various plugins don't need to know how to deal with
it themselves. You might be better off by configuring root access in
Vagrantfile, see
https://stackoverflow.com/a/25758738 for an example.
2) Add the ssh-key of user "vagrant" to the authorized keys
in the machine?
The key is in .vagrant/machines/{{hostname}}/virtualbox/private_key
The above link should have all the details. In Vagrantfile, you do this by
adding:
config.ssh.username = 'root'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'true'
Best Regards,
Maciej Delmanowski