Closed ajcollett closed 2 years ago
I'm seeing this too and it's creating the file if it doesn't exist. There is an arg create
to file.managed
that can be set to False
to disable creation of the file if it doesn't exist.
So I assume that would need to be updated in the formula?
@ajcollett @lmf-mx Thanks for the report, this has been fixed in #528. Feel free to comment on how this works out for you.
@myii you beat me to it! I was about to create a pull request with exactly the same. Cheers!
I tested in locally before doing a fork. It seemed to work well for me.
:tada: This issue has been resolved in version 1.10.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
@myii Checking for remove is even better, avoids the state ever hitting the output.
Thanks!
@myii you beat me to it! I was about to create a pull request with exactly the same. Cheers!
I tested in locally before doing a fork. It seemed to work well for me.
You're welcome, @ajcollett -- good to hear that it's working as expected.
@myii Checking for remove is even better, avoids the state ever hitting the output.
@lmf-mx Yes, while there are other options, the minion.sls
file is pretty messy, so this was the easiest way to get the job done!
Your setup
Formula commit hash / release tag
I am using the master branch for this formula, salt-formula.
Versions reports (master & minion)
Salt is on version 3004 on both master and minion.
Pillar / config used
Bug details
Describe the bug
When using
minion_remove_config: true
2 states are enforced every run:remove-default-minion-conf-file
permissions-minion-config
That is, the minion file is removed, then recreated and managed. In code, only the first is surrounded by an
if
, but the 2nd always runs.Steps to reproduce the bug
minion_remove_config: true
in pillar.state.apply
sate.apply
orstate.highstate
is run.Expected behaviour
The file should be removed when the
minion_remove_config
setting is set to true.Attempts to fix the bug
The permissions state should probably only be run when
minion_remove_config
is set to false. I have not tested this.