It appears that if you have a require with sls: foo
and foo.sls itself only has include:
statements the requirement fails.
When the command salt \* state.highstate test=True
the following is output;
example.com:
----------
ID: eggs
Function: cmd.run
Name: echo "I should be required..."
Result: None
Comment: Command "echo "I should be required..."
" would have been executed
Started: 00:39:21.139595
Duration: 5.831 ms
Changes:
----------
ID: bar
Function: cmd.run
Name: echo "I require foo.sls, which includes eggs.sls"
Result: False
Comment: The following requisites were not found:
require:
sls: foo
Started:
Duration:
Changes:
Summary
------------
Succeeded: 1 (unchanged=1)
Failed: 1
------------
Total states run: 2
If one replaces the contents of foo.sls
with eggs.sls
the requirement works as expected;
example.com:
----------
ID: eggs
Function: cmd.run
Name: echo "I should be required..."
Result: None
Comment: Command "echo "I should be required..."
" would have been executed
Started: 00:43:08.872786
Duration: 0.312 ms
Changes:
----------
ID: bar
Function: cmd.run
Name: echo "I require foo.sls, which includes eggs.sls"
Result: None
Comment: Command "echo "I require foo.sls, which includes eggs.sls"
" would have been executed
Started: 00:43:08.873174
Duration: 2.522 ms
Changes:
Summary
------------
Succeeded: 2 (unchanged=2)
Failed: 0
------------
Total states run: 2
Therefore, is this a bug, feature, not supported in Salt or (I'd imagine more the case) am I just doing something wrong.
This is a trivialised example, ideally I'd be putting multiple includes in foo.sls
that I can reference in multiple requires throughout my states.