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

How to use a custom inventory file with ansible-bender? #277

Open
cryobry opened this issue Aug 5, 2022 · 5 comments
Open

How to use a custom inventory file with ansible-bender? #277

cryobry opened this issue Aug 5, 2022 · 5 comments

Comments

@cryobry
Copy link

cryobry commented Aug 5, 2022

I'm trying to run ansible-bender on a remote SSH host found in my inventory.

I have tried passing the custom inventory file as an additional argument to ansible-bender:

ansible-bender build --extra-ansible-args "-i ./inventory" ./ab-playbook.yml

...but the inventory is ignored and the image is still built locally. Is there any way to run ansible-bender on the remote host specified in my inventory/playbook?

@themkat
Copy link
Contributor

themkat commented Aug 7, 2022

ansible-bender builds its own inventory, and ignores any existing inventory files. This causes other issues as well, like delegation not working #266.

To my knowledge, there isn't any way to make it work at the moment. Please correct me if I'm wrong @TomasTomecek

@TomasTomecek
Copy link
Collaborator

@themkat you're right

ansible-bender in its current architecture cannot work with remote machines - it uses inventory to "connect" to locally running containers.

If you wish to access a remote host, you need to write the inventory and a playbook and invoke ansible-bender inside that playbook, as any other commands you'd want to run on the host.

@drakowel

This comment was marked as spam.

@drakowel

This comment was marked as spam.

@drakowel

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants