requiring sls file containing only includes fail
See original GitHub issueI have the following file structure:
includetest/init.sls
includetest/subtestfile.sls
includetest/testfile.sls
init.sls:
include:
- includetest.testfile
/home/deploy/testfile2.txt:
file.managed:
- contents: Hello
- require:
- sls: includetest.testfile
testfile.sls:
include:
- .subtestfile
subtestfile.sls:
/home/deploy/subtestfile.txt:
file.managed:
- contents: Hello
When running salt-call state.sls includetest
, I get:
State: - file
Name: /home/deploy/testfile2.txt
Function: managed
Result: False
Comment: The following requisites were not found:
require:
sls: includetest.testfile
Playing around a bit, it appears that this is caused by requiring a file containing only includes. A workaround is to modify testfile.sls to do some arbitrary work.
Is this a bug or by design? My use-case is to have a file including a bunch of states and requiring that file from various places. (Tested on 0.17.5)
Issue Analytics
- State:
- Created 10 years ago
- Reactions:5
- Comments:26 (15 by maintainers)
Top Results From Across the Web
Requisites and Other Global State Arguments
The onchanges requisite makes a state only apply if the required states generate changes, and if the watched state's "result" is True (does...
Read more >Require sls by its ID Declaration - salt stack
The module php/init.sls contains only one ID Declaration : {pkg: php53u}. ID Declaration is composed of state name (pkg) and component name ...
Read more >SaltStack: Call a single state of a sls file - Server Fault
I came across this post while also trying to figure out how to do this with regular salt calls (ie. not salt-ssh).
Read more >Using states for configuration management | Mastering SaltStack
Requisites point to a list of items elsewhere in the SLS file that affect the behavior of the state. Each item in the...
Read more >salt.states.file - Read the Docs
Regular files can be enforced with the managed function. ... clean: Make sure that only files that are set up by salt and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Belated happy 3rd birthday to this bug 😉 Is there sometimes a fix to be in sight? Since on other usages this multilevel references are unproblematic (pillar, grains, sls references for includes) it shouldn’t be too problematic / difficult to get here also a solution?
The above mentioned workaround could /has to be used then but I was just trying to avoid single state reference and use a whole sls as required_in because saltstack likes to play dice with state ordering already also in the referenced sls
I think it is still an issue