bsdci / libioc

A Python library to manage jails with ioc{age,ell}
https://bsd.ci/libioc
Other
38 stars 11 forks source link

Provision from custom repo #660

Open urosgruber opened 5 years ago

urosgruber commented 5 years ago

I would like to simplify some provisioning code on our end and can see ix provisioning could work except it uses ix repo. Is there an option to change the repo or would this need to be a custom provisioning method?

igalic commented 5 years ago

in the puppet provisioning plugin currently supports two modi for the source parameter: it can either be an absolute path on the host which is mounted into the jail, or it's a URL that will be cloned and processed by r10k

i can imagine a similar mode change in the iX plugin

gronke commented 5 years ago

@urosgruber you can build that yourself by inheriting from the ix-plugin provisioner and overwriting Provisioner.__get_url():

https://github.com/bsdci/libioc/blob/a56658513d9bc663af72e241109e466e2f517f0b/libioc/Provisioning/ix.py#L92-L96

urosgruber commented 5 years ago

I'll try one, need to learn some Python basics first :) I'll create a PR when I'm done.

urosgruber commented 5 years ago

While testing existing ix plugin I see that there are couple of issues in the code. I'll try to fix this first and maybe it's worth making the plugin better. Also it's very much different behaviour than the one from iocage