Conversation
The "Create virtualhosts" task was gated on sites_enabled_check.stdout == "1", but a fresh system's grep returns "0" on the very run that adds the IncludeOptional line, so configured virtualhosts were silently skipped until a second run. The underlying create.yml tasks (template + symlink) are already idempotent, so running them unconditionally is safe.
Member
|
we need to test and confirm this with @alexmerlin |
alexmerlin
reviewed
Oct 3, 2026
| include_role: | ||
| name: virtualhost | ||
| tasks_from: create | ||
| when: sites_enabled_check.stdout == "1" |
Member
There was a problem hiding this comment.
TLDR: This checks stops the recipe from attempting to create a virtualhost even when it already exists.
Please explain why do we need to remove this, and more specifically, why only here?
Because, if you look closely, there's another check involving this variable on L19.
The variable is registered on L12 as a result of checking whether "sites-enabled config files are already added to Apache config" (see L10). And, based on its value, certain things happen L14/L24.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when: sites_enabled_check.stdout == "1"condition gating the"Create virtualhosts" task in
wsl/roles/virtualhost/tasks/main.yml.run that added the
IncludeOptional sites-enabled/*.confline, so anyconfig.virtualhostsentries were silently skipped until a secondinstall.ymlrun.create.ymltasks (template + symlink) are alreadyidempotent, so removing the gate is safe to run on every invocation.