-
Notifications
You must be signed in to change notification settings - Fork 8
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
Pillar support? #22
Comments
@dizzythinks We haven't needed SaltStack pillar support, but this could be added pretty easily. The reason we haven't needed pillar support is that we're using this to build Docker images that would be instantiated later (build time), rather than being managed by Salt when they are running (run time). But I can see that it might be handy to put some configuration options in pillars. What do you want to do with the pillars? What would you need it for? |
I was thinking specifically of using masterless pillar at build time for things like nginx config files where I might want to use different values for things like paths to SSL certs, server name variables etc based on different environments potentially, or just generally the ability to use Jinja. I have a fairly rich repository for saltstack already that uses a number of template driven methods to configure and am looking to do a migration piece to docker and would like to minimise potential rewrite of things. |
Sorry when I say build time I mean building a container that has relevant configuration included that is built from Jinja templating in some cases. |
Being able to use the nginx formula is a good example of where pillar support would be handy. |
@dizzythinks So you would like to have pillar files copied to the right place on the minion then? Would you be willing to share a repo or point me at an example that uses pillars that I could use to try out some code? |
Yeah, basically I was thinking that in the example where there is is the salt folder there could also be a pillar folder. I can create a little sample for you tomorrow to have a look at as I'm in the UK. Will drop a link in here in the morning if that's ok. Really appreciate you taking the time to look! |
@dizzythinks It would be great if you could send an example! What would be great is some sls/pillar files that you know work, and with a sentence or two about what you would like to have happen with FlyingCloud. If you can do that I can think about how to implement it and maybe take a shot at adding this- |
Hi, I have thrown some really simple example of what I was thinking up here: https://github.com/dizzythinks/flyingcloud-example Let me know if its not enough or sufficient. Thanks again |
@dizzythinks Thanks for the example - that should be sufficient. I will take a shot at it and let you know when I have something that works so you can try it out. |
Sounds like a great idea. I'm going to leave this in @adamfeuer's hands for now. |
@dizzythinks I added your example to this branch: https://github.com/cookbrite/flyingcloud/tree/feature/pillar-support/examples/nginx-pillar I'm going to give it a try now... might take a bit before I get something working. |
@dizzythinks Seems each pillar should be a directory, with its own I'm going to do it the way shown in the SaltStack example- but am open to doing it differently, let me know your thoughts. |
No that's cool, my example was more for easy demarcation in the repo, but with the idea that |
@dizzythinks Ok got basic pillar support working on this branch. You can pull it and try to build the example. Here's the workflow:
The example underwent some changes to get it working, will you look at it to see if it will work for you? |
Thanks @adamfeuer I will get on to this today and try it out. |
@adamfeuer this looks perfect and works in exactly the way I imagined pretty much. The changes in the pillar structure are fine as I made the mistake of forgetting it was a masterless example so missed out the One thing that might be nice - although it could be fixed with a script after use - would be if pillar is used that the container image name is suffixed with the pillar used? e.g. Like I say, I can do that myself around this if it breaks the pattern behaviour of flyingcloud. Either way this is brilliant and as I say, exactly how I imagined it working. |
@dizzythinks Cool, I'm glad this works for you. It will be pretty easy to add the pillar name to the image tag. I'll take a shot at that soon. Then need to write some tests so I can do a Pull Request. |
@dizzythinks I added the pillar name to the docker tag - only happens if there is a pillar specified. (Here's the commit.) Will you check this out and see if it's what you imagined? I'll work on some tests this weekend and see if can get this reviewed and merged. |
@adamfeuer I've pulled the change - checked the git log to be sure - but it doesn't seem to work for me. It seems to always tag as "dev" even when explicitly setting --pilar qa
|
@dizzythinks Thanks for finding that! I think I know what's wrong, will try to fix it tonight. |
@dizzythinks ok, I think I fixed it, will you try this one with both |
Here's a run setting the
|
Hey @dizzythinks, have you tried this branch out with the fixes? Just want to see if it's working before I start to work on merging it. |
Hi. Sorry, I've been away. I did test it and it was all good, I just seem to have forgotten to post and tell you. Sorry. |
@dizzythinks No problem, and thank you so much for your great ideas and help! I will work to get this code-reviewed and merged. |
👍 |
Did this get merged yet? |
@dizzythinks No, I'm sorry - I had to work on other things for a while. I will make a Pull Request this weekend. Or you can do that too. :-) |
Any updates on this? |
Looking through the example I see it's doing general state stuff. Does it support accessing pillar information as well?
The text was updated successfully, but these errors were encountered: