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
salt-call --local with gitfs #6660
Comments
This would be cool, thanks for the suggestion! |
+1 for this. I started looking at it today - but have the feeling I'll do more harm than good hacking it in! Pointers on where to start are very welcome. |
I was about to write about this, but I'm glad someone found a need for it too! I genuinely thought salt would simply read a gitfs remote under |
+1 |
2 similar comments
+1 |
+1 |
+1 I could definitely use this for vagrant + masterless salt + formulas. |
I've found that salting a salt master is actually a very good alternative to |
+1 and I agree with @ryan-lane |
+1 |
9 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
This would also bring support for using state.orch on purely gitfs backed systems. Orchestration files in a git repo just make sense. |
@gepoch What's stopping you from using gitfs with state.orch now? |
At the moment (in 2014.1.4)
I can access all of the formulae in the same git repo with no problem. Looking at the source (although this may have been a few patch versions ago) seemed to suggest that it wasn't capable of using the gitfs backend, but I could definitely be wrong about that. It should just be a matter of configuring the gits_remotes to point to the right git repo, right? |
Theoretically, yes. And the I should note that |
Yeah, I'm wise to the master-base mapping and that's already okay. I'm guessing it's in the |
+1! |
+1! This would be great for vagrant/docker/masterless salt boxes. |
@davidkarlsen @ryan-lane What's the work around you two are using for a masterless Vagrant setup? Copy/paste the needed formulae into your local environment? |
For vagrant I used master/minion, which kind of sucks since I'm aiming for masterless in production. Note that I'm mostly using gitfs to make it easier for devs to quickly test things from formulas. |
Both options would be possible. Either do checkouts to a local dir and include this in a masterless, or set it up as master/slave on and use gitfs. I´d probably go for the latter. |
FWIW a work around for this in masterless setup is to use git submodules to add to the necessary states. |
+1 agree with @cackovic ... I just wasted an hour trying to get this to work, because the docs say it does. |
@plainlystated Sorry! I created #15444 to solve this doc issue for the time being. |
@basepi sweet thanks! |
This has to do with the fact that the LocalClient does not use the salt.fileserver.Fileserver class to allow for the use of the modular fileserver. It hard-codes the use of file_roots. This means that none of the modular backends work, not just gitfs. I will look into this. |
+1 This is really the only thing that keeps me from using "formulas". I don't work with large numbers of servers that have a need to stay up for long so I never really end up needing a "master" server. I just use vagrant-aws with Salt in "local" mode and bootstrap all my states with a shell script and git. It would be sooooo much nicer to just configure that bit in the minion as a gitfs. IMHO this is the key to getting more people using Salt with Vagrant. As of right now you can't really use formulas properly. |
This should be fixed in 2014.7.0. |
I am super excited if that is true! Looks like that release is about to wrap up as well :) |
@terminalmage Any idea if |
@howardroark Regarding the initial content of your last post, the log message was there because Salt has switched to pygit2 as the preferred interface to git in 2014.7.0. GitPython is still supported, and as you can see from the log there, it did detect GitPython. You can squelch that warning by setting The git external pillar is not the same thing as gitfs and has not yet been modified work with pygit2. We are targeting a rewrite for one of the next 2 feature releases. |
@terminalmage Thanks for detailed response :) I deleted my last post because I soon realized that my core issue was not related to that message. Great tip though! Seems pygit2 and libgit2 are having install issues on Ubunut 14.04, either way gitpython was a much simpler install. |
Yeah, this is covered in the GitFS Walkthrough. A relatively new version of pygit2 is required, in order to support repo authentication, and it's not yet packaged on many Ubuntu releases. We've considered creating a PPA for this, but it's lower on the priority list with a new feature release imminent. |
@terminalmage I am not sure if I am setting things up wrong on the minion, but Jinja seems to have trouble finding files.
|
@howardroark that's a duplicate of #17963. |
Thanks @khrisrichardson ! Cool, well at least I know I am on the right track. This is soo close! It's gotta work with formulas to be official though. |
@terminalmage I guess this will be officially working as soon as a new Thanks for getting all this working btw! |
Yes, the release should be cut soon and handed off to QA for a round of testing, then handed off to packagers before it is officially released, hopefully next week. |
@terminalmage I think this issue can be closed with the release of 2014.7.x |
Good call, thanks for the reminder. |
still not fixed? |
This is fixed @bashu |
I want to use gitfs in masterless mode. |
@adityajain21 no there isn't any documentation specific for the masterless setup, something like:
|
I inserted these lines in the /etc/salt/minion file. |
@adityajain21, this is just an example, please adjust, if you use pygitfs or dulwhich or gitpython, |
@adityajain21 There is nothing special that you need to do to use gitfs in masterless mode, aside from adding the gitfs configuration to |
I would like to propose the gitfs support for salt-call.
This would enable a lot of cool stuff: like easier deployment from saltstack-formulas
using docker.io or packer.io without the overhead of a complete salt-master installation.
Requirements as I think of is that salt-call needs to parse /etc/salt/master.d/ or
/etc/salt/minion.d/ files for correct information about what gitfs remotes there are..
The text was updated successfully, but these errors were encountered: