Skip to content

Fix virtualhost creation being skipped on first playbook run - #130

Open
bidi47 wants to merge 1 commit into
alma-linux-10from
docs/fix-virtualhost-first-run-gate
Open

bidi47 wants to merge 1 commit into
alma-linux-10from
docs/fix-virtualhost-first-run-gate

Conversation

@bidi47

@bidi47 bidi47 commented Sep 24, 2026

Copy link
Copy Markdown
Member
  • Removes the when: sites_enabled_check.stdout == "1" condition gating the
    "Create virtualhosts" task in wsl/roles/virtualhost/tasks/main.yml.
  • On a fresh system, this condition previously evaluated false on the very
    run that added the IncludeOptional sites-enabled/*.conf line, so any
    config.virtualhosts entries were silently skipped until a second
    install.yml run.
  • The underlying create.yml tasks (template + symlink) are already
    idempotent, so removing the gate is safe to run on every invocation.
  • Resolves audit finding test ansible recipe on Windows 10 #2 ("Virtualhosts aren't created on the first run").

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.
@bidi47
bidi47 requested a review from arhimede September 24, 2026 15:49
@arhimede

Copy link
Copy Markdown
Member

we need to test and confirm this with @alexmerlin

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants