You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Salt formulas should be considered as a new root #6739
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.
The issue came up with the new formula structure and this issue should be considered a bug in my point of view.
Firstly the documentation is misleading and not complete, but that's besides the point here ^^
We want to encourage more people to contribute back and cherry picking is not helping there.
As mentioned above the gitfs_remote already handles it quite well, but having manual submodules or even just checked out formulas doesn't yet work. As the convention is to use *-formula as submodule-folders and repo name, it could be a start to strip the top level directory, when folders within the root are called *-formula. and don't have any .sls files in this directory. Could that be possible?
Cheers
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 file_roots is a crappy workflow. In fact, I'd like to go one step higher than that and say having to manually clone a repo at all is less than ideal. @akoumjian has started work on "spm", a Salt Package Manager, which handles cloning/fetching the repo/package. It's roughly usable now and will likely land in Salt core by next week. There's still a use-case for manually putting stuff in file_roots, of course, but when working with salt-formulas I (personally) would prefer to avoid any manual steps.
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.
and then installing it:
spm local install /srv/spm/zsh-201506-1.spm
Installing package from file /srv/spm/zsh-201506-1.spm
Proceed? [N/y] y
... installing
I believe this is not my version of spm, tech hat did a rewrite and that is
the one in the pr
On Tue, Jun 30, 2015 at 14:40 Niels Abspoel [email protected]
wrote:
and then installing it:
spm local install /srv/spm/zsh-201506-1.spm
Installing package from file /srv/spm/zsh-201506-1.spm
Proceed? [N/y] y
... installing
@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?
@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:
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.
Activity
stp-ip commentedon Aug 16, 2013
The issue came up with the new formula structure and this issue should be considered a bug in my point of view.
Firstly the documentation is misleading and not complete, but that's besides the point here ^^
We want to encourage more people to contribute back and cherry picking is not helping there.
As mentioned above the gitfs_remote already handles it quite well, but having manual submodules or even just checked out formulas doesn't yet work. As the convention is to use *-formula as submodule-folders and repo name, it could be a start to strip the top level directory, when folders within the root are called *-formula. and don't have any .sls files in this directory. Could that be possible?
Cheers
@UtahDave
whiteinge commentedon Aug 16, 2013
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
file_rootsis a crappy workflow. In fact, I'd like to go one step higher than that and say having to manually clone a repo at all is less than ideal. @akoumjian has started work on "spm", a Salt Package Manager, which handles cloning/fetching the repo/package. It's roughly usable now and will likely land in Salt core by next week. There's still a use-case for manually putting stuff infile_roots, of course, but when working with salt-formulas I (personally) would prefer to avoid any manual steps.akoumjian commentedon Aug 16, 2013
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.
Improved Formula installation instructions
aboe76 commentedon Jun 30, 2015
@akoumjian I don't see the symlink at the moment am I missing something?
So far I can do the following:
spm build /home/aboe/Development/git/zsh-formula/
which creates /srv/spm/zsh-201506-1.spm
spm info zsh:
spm files zsh
and then installing it:
spm local install /srv/spm/zsh-201506-1.spm
Installing package from file /srv/spm/zsh-201506-1.spm
Proceed? [N/y] y
... installing
/srv/salt/ # tree zsh
shouldn't it be:
But than again you will be missing the README.rst and LICENSE file...
akoumjian commentedon Jul 1, 2015
I believe this is not my version of spm, tech hat did a rewrite and that is
the one in the pr
On Tue, Jun 30, 2015 at 14:40 Niels Abspoel [email protected]
wrote:
techhat commentedon Jul 1, 2015
Yes, this is a complete rewrite.
aboe76 commentedon Jul 1, 2015
@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?
xlotlu commentedon Jun 9, 2016
How about supporting wildcards? This feels straightforward and natural:
lorengordon commentedon Jun 10, 2016
@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
mysql-formula.mysqlandphp-formula.php. The desired state references are justmysqlandphp.xlotlu commentedon Jun 10, 2016
@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
mysqlandphpstates accessible directly as desired.lorengordon commentedon Jun 10, 2016
@xlotlu, ahh, no, I'm the one missing the obvious. That implementation is perfectly clear when explained with the example like that.
ghostsquad commentedon Dec 29, 2016
Is this problem solved with the officially supported/created Salt Package Manager (SPM)?
https://docs.saltstack.com/en/latest/topics/spm/master.html#installing-packages
stale commentedon Aug 11, 2018
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.