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

[Feature Request] Support bind mounts in container provisioner #16

Open
C-512L opened this issue Apr 11, 2023 · 2 comments
Open

[Feature Request] Support bind mounts in container provisioner #16

C-512L opened this issue Apr 11, 2023 · 2 comments

Comments

@C-512L
Copy link

C-512L commented Apr 11, 2023

One use case mentioned in docs/provisioning.md for the container provisioner is using a external provisioning tool such as ansible but there is no way to pass configuration/secrets (such as inventories and playbooks) to the running container.

@JoelColledge
Copy link
Member

Thanks for the suggestion. I can imagine there could be use cases for custom bind mounts.

there is no way to pass configuration/secrets (such as inventories and playbooks) to the running container

Note that:

In addition, every container binds the following paths:

  • The current working directory of Virter, exposed read only at /virter/workspace
  • The SSH private key Virter used to connect to the machine as root at /root/.ssh/id_rsa
  • The SSH known hosts file, prefilled for connecting to the machine at /root/.ssh/known_hosts

These bind mounts have so far been sufficient for provisioning with ansible. Virter is run from the directory containing the playbooks. The SSH key is the secret required for accessing the VMs. The TARGETS environment variable is used to construct the inventory.

There is some work to do to glue that all together. I'm afraid I'm not aware of a publicly available example of how to do it.

Is that sufficient in your case?

@C-512L
Copy link
Author

C-512L commented Apr 13, 2023

Note that:

In addition, every container binds the following paths:

  • The current working directory of Virter, exposed read only at /virter/workspace
  • The SSH private key Virter used to connect to the machine as root at /root/.ssh/id_rsa
  • The SSH known hosts file, prefilled for connecting to the machine at /root/.ssh/known_hosts

Thanks for pointing me out about the /virter/workspace mount. I don't know how but i had missed that part in the docs.
Still, I think it could be quite useful for some cases like adding upper/external directories or for caching temporal files.
This issue can be left open as a possible future improvement.

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

2 participants