-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 formulas should be considered as a new root #6739
Comments
The issue came up with the new formula structure and this issue should be considered a bug in my point of view. |
This doesn't directly address the issue but it's related so I'll point it out anyway: You're right that manually cloning a repo and somehow linking or copying it in to |
Yep, ran into this when first working on SPM. Currently it works (crudely) by grabbing the first root in file_roots['base'] and pillar_roots['base'] and them symlinking the package contents into the appropriate respective folders. As an alternative to symlinking, I also considered a way of dynamically adding an SPM specific file_root/pillar_root, but this would require parsing and modifying the user's master config, which I don't like. The second problem with this is that the now there is a separate location where users would have to find formula packages in order to edit the pillar/template files. |
@akoumjian I don't see the symlink at the moment am I missing something? So far I can do the following: which creates /srv/spm/zsh-201506-1.spm spm info zsh:
spm files zsh
and then installing it: /srv/salt/ # tree zsh
shouldn't it be:
But than again you will be missing the README.rst and LICENSE file... |
I believe this is not my version of spm, tech hat did a rewrite and that is
|
Yes, this is a complete rewrite. |
@techhat any Idea on how to tackle this, I would like to see spm install a package that is readily available to use in top.sls referencing the package name zsh instead of zsh.zsh. samething with the naming convention spm package zsh, while it is realy zsh-formula on gitfs? |
How about supporting wildcards? This feels straightforward and natural:
|
@xlotlu, the wildcard approach doesn't solve the problem that kiorky mentioned in the OP of how to reference the state... Give this file_roots definition:
And this folder structure:
The resulting state references would be |
@lorengordon excuse me if I'm missing something obvious. Given your directory structure, the state references you describe would result only if there wasn't a wildcard:
With a wildcard, the internal representation after parsing the glob would be just as if one defined:
making the |
@xlotlu, ahh, no, I'm the one missing the obvious. That implementation is perfectly clear when explained with the example like that. |
Is this problem solved with the officially supported/created Salt Package Manager (SPM)? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Today, it is impossible to use a new manually checkouted formula without having to declare it in the master file_roots. The behavior indicated on https://salt.readthedocs.org/en/latest/topics/conventions/formulas.html#adding-a-formula-directory-manually is wrong as it is then more that dropping a directory inside your salt states's root.
To fix that, when we use formulas as a local checkout, the top level directory should be stripped off of the resolution.
eg: if you have /srv/salt/salt-formula/salt/init.sls
Other states can then "include salt" rather having to include "salt-formula.salt"
Evidently, without, the fileserver can not resolve the "salt" directory inside the "formula checkouted directory" when you would have used "include .saltcheckoutdir.salt"
Indeed, it works for gitfs_remote, but it's because the remote is considered as a new root strippening then the offending top directory.
To sum up, I think the behavior with a local checkout of a formula and using it as a gitfs_remote should be the same and local checkouts should be picken up without any further configuration upon the initial checkout.
Related to saltstack-formulas/salt-formula#4
@thatch45 @basepi @AntoineCezar
The text was updated successfully, but these errors were encountered: