As pointed out by @Yoda-BZH in Slack, the previous implementation of the vhosts.cleanup SLS allowed removing unwanted vhosts but keeping the service running.
In the discussions that followed, it appeared that the best resolution would be to reset this to its original form and then provide a separate vhosts.clean SLS (removing the symlink that was being used).
Essentially, there are two use cases that need to be covered, so the symlink wasn't the right approach:
Removing unwanted vhosts but leaving the service running (i.e. cleanup).
Clearing the vhosts as part of cleaning (uninstalling) the whole Apache installation (i.e. clean).
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
[ ] Updated the README (e.g. Available states).
[ ] Updated pillar.example.
Testing checklist
[ ] Included in Kitchen (i.e. under state_top).
[ ] Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Fixes #373.
Describe the changes you're proposing
https://saltstackcommunity.slack.com/archives/C7LG8SV54/p1634649838072400
vhosts.cleanup
SLS allowed removing unwanted vhosts but keeping the service running.vhosts.clean
SLS (removing the symlink that was being used).cleanup
).clean
).Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context