gu1 / ansible-lxc-remote Goto Github PK
View Code? Open in Web Editor NEWAnsible connection backend to manage remote LXC containers
License: GNU General Public License v3.0
Ansible connection backend to manage remote LXC containers
License: GNU General Public License v3.0
Is there a way to specify the container name? right now if I have a container named "webs" in two different hosts, I can't define both. Can something like this be done:?
host1_webs container_name=webs ansible_ssh_host=....
host2_webs container_name=webs ansible_ssh_host=....
Thanks!
Hi,
I am testing the plugin, but I get this error when I add it to the library path (ansible v1.9.2).
Traceback (most recent call last):
File "/usr/bin/ansible", line 197, in <module>
(runner, results) = cli.run(options, args)
File "/usr/bin/ansible", line 121, in run
inventory_manager = inventory.Inventory(options.inventory, vault_password=vault_pass)
File "/usr/lib/pymodules/python2.7/ansible/inventory/__init__.py", line 141, in __init__
self._vars_plugins = [ x for x in utils.plugins.vars_loader.all(self) ]
File "/usr/lib/pymodules/python2.7/ansible/utils/plugins.py", line 233, in all
yield getattr(self._module_cache[path], self.class_name)(*args, **kwargs)
AttributeError: 'module' object has no attribute 'VarsModule'
From comparing the code of _ssh.py in your module to ssh.py in ansible v1.9.2, it looks like the module doesn't support the become_user changes.
Any ideas?
Thx
@Gu1 do you have plans to support Ansible 2.0? I would like to include your software in the next release of the TurnKey GNU/Linux Ansible appliance for managing containers on a TurnKey LXC appliance.
Hi,
I'm trying to connect from a controller machine ($USER==vagrant) through a remote lxc container (as user root2) to a container (as root).
However, it seems that the lxc-attach is being told to execute su as "vagrant" instead of "root", which doesn't exist in the container.
How can I set self.runner.remote_user
on lxc_remote.py:71
?
This happens when gathering facts.
inventory file:
remote-lxc-host ansible_connection=ssh ansible_ssh_port=222 ansible_ssh_user=root2 ansible_ssh_host=remote-lxc-host.somewhere.net
lxc-guest ansible_connection=lxc_remote ansible_ssh_host=remote-lxc-host.somewhere.net ansible_ssh_port=222 ansible_ssh_user=root
exec log:
GATHERING FACTS ***************************************************************
<remote-lxc-host.somewhere.net> ESTABLISH CONNECTION FOR USER: root
<remote-lxc-host.somewhere.net> REMOTE_MODULE setup
<remote-lxc-host.somewhere.net> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=15s -o GSSAPIAuthentication=no -v -o ForwardAgent=yes -o ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=222 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=20 remote-lxc-host.somewhere.net /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=gdcqpaagsswbweppbchwrcexoykwuovm] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-gdcqpaagsswbweppbchwrcexoykwuovm; lxc-attach --name lxc-guest -- /bin/su vagrant -c '"'"'"'"'"'"'"'"'mkdir -p /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719 && chmod a+rx /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719 && echo /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719'"'"'"'"'"'"'"'"''"'"''
fatal: [lxc-guest] => Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719 && chmod a+rx /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719 && echo /tmp/.ansible/$USER/ansible-tmp-1443830335.6-24620548920719, exited with result 1: BECOME-SUCCESS-gdcqpaagsswbweppbchwrcexoykwuovm
No passwd entry for user 'vagrant'
Thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.