-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix: Ensure Vagrant default provisioning mode is "once" #107
Conversation
I can't find the reason for it in git but I think that disabling the provisionning step of vagrant is done on purpose. Since ansible is used later, the instance configuration is supposed to be done with the prepare step. If the problem is missing python for ansible, it can probably be done with the raw module. What the problem you're having exactly / you're trying to solve ? I don't see that explained clearly in your description. |
This is a very surprising stance! Vagrant provides 3 options for provisioning:
Where the provisioning shall be done is to be decided on a case-by-case basis. |
I was trying to say that some author of the project has chosen some default, possibly due to the fact that the provisionning should rather be done with molecule prepare step. Of course, it should be possible to override the default and your problem (if I finally understood correctly) is that you can't override it with the value you want. The problem is not the default value.
I've not tested on my test VM but looks like your change is only changing the default value to match the missing use case instead of properly adding support for it. As long as this PR is modifying the default plugin behavior, imho, this PR is wrong. |
The molecule plugin is changing the default Vagrant and |
I don't see the problem with current molecule-vagrant default behavior. Bootstrapping is supposed to be handled by create.yml or prepare.yml playbooks of molecule, that's their purpose. If this can't be done with molecule, then obviously, it should be possible to configure things to run vagrant provisioning step. And that's were the problem is, since you can't run it "once". |
i think there is a disconnect here between what the role of python-vagrant and the molecues vagreant plug. python-vagrant provides python binding for interacting with vagrant with the intent of maintaining the same behavior of vagrent. the molecule vagrant plugin shoudl be consitent with the other plugins. but that does not mean all of the defaults should be the same as the backend provider. so it makes sense form a molecule plugin point of view to prefer having one standard way to provision the host using the prepare playbooks. so i tend to agree with apatard. i would not change the default to align with vagrant. what could be done is change the type form bool to an enum of exposing the 3 backend values false -> never (default) in code the strign enums will have to be converted to a bool when invoking python-vagrant 'false' -> False that makes the plugin code a little more the other thing that might work without code change would be to try using the yaml null value instead of the string 'none'. null when parsed into python should get converted to python None if that works the docs could just get updates to detail that usage. |
I have a fix ansible-community/molecule-vagrant#174 before migration, and now as #155 which is working fine for my daily CI. |
Issue closing duly noted. I will have tried.
This is precisely what I was attempting to address: the molecule Vagrant plugin differs from Vagrant behaviour-wise. |
Considering:
python-vagrant
forprovision
isNone
python-vagrant
documentation states the boolean is optional, defaulting to Vagrant default behaviour (which is to run provisioners once on creation)The Molecule's Vagrant plugin currently override the default value, defaulting to
False
, and only settable toTrue
(None
is rejected, not being a boolean).This PR suggests a change so the default value of the Molecule plugin is aligned with
python-vagrant
's one, and eventually with Vagrant's behaviour.