Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXD connector #677

Open
benoitjpnet opened this issue Oct 11, 2021 · 4 comments
Open

LXD connector #677

benoitjpnet opened this issue Oct 11, 2021 · 4 comments
Labels
connectors Connector issues - builtin integrations with other tools.

Comments

@benoitjpnet
Copy link

benoitjpnet commented Oct 11, 2021

Hello,

The goal would be to have a LXD connector so we can use it like:

pyinfra @lxd/<containerName> [...]

In the back-end it should probably use lxc exec <containerName> -- <command>

Related: #388

Thanks,

@Fizzadar Fizzadar added the connectors Connector issues - builtin integrations with other tools. label Oct 15, 2021
@fingon
Copy link

fingon commented Aug 5, 2022

I'd like to have this and have the connectors somehow composable, as the machine I am running pyinfra from ISN'T one of those running lxc. Due to that, lxcssh (or something would be also nice to have.

I might tackle writing something for my use, although as my use is really (at the moment at least) limited I'm tempted just skipping pyinfra and doing stuff by hand :-) Still, keeping an eye on this issue.

I suppose one option would be just writing pyinfra stuff which ssh's pyinfra configs to machines, and then runs them with lxc connector if any; without lxc connector, it could also copy them to the lxc container and run pyinfra there but I'd rather not install pyinfra in N places if one is enough.

@Fizzadar
Copy link
Member

The @dockerssh connector implements this kind of thing, but it's not a composable combination of @ssh and @docker connectors (which would be awesome to have).

@dontlaugh
Copy link

dontlaugh commented Jan 17, 2023

I don't know which approach is better, but the LXD project maintains an official Python SDK

https://github.com/lxc/pylxd/blob/master/setup.cfg#L16

Shelling out to lxc works fine, as well. This is how the Puppet Bolt integration was created for LXD. That was Ruby, though, so using an official library wasn't an option.

Both have their advantages. Relying on the lxc binary works, and is simpler, but usage of the SDK would likely make implementing an @lxdssh feature easier? idk.

@Fizzadar What's your preference regarding taking on python deps?

@opekar
Copy link

opekar commented Feb 2, 2025

#1282 lxc connector for inspiration, push and get file would be done directly via lxc file push/pull commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectors Connector issues - builtin integrations with other tools.
Projects
None yet
Development

No branches or pull requests

5 participants