Files
ansible-playbooks/roles/static_web
Clément Désiles 1970564c8f refactor: drop shared-service meta dependencies from service roles
podman, postgres, valkey, and nginx are shared services deployed once
per host. Declaring them in meta/main.yml re-ran them on every service
deploy, adding significant time to targeted runs. Playbooks now list
shared services first (tagged 'infra') and every role entry carries a
group tag plus its own name, so '--tags <role>' deploys just that role.

Roles still fail fast when a shared service is missing (password
asserts, postgresql tasks). Prerequisites are documented in role
READMEs. CLAUDE.md updated to reflect the new convention.
2026-07-04 00:15:50 +02:00
..
2026-05-29 21:27:00 +02:00

static-web

Deploy static websites from Git repositories with Nginx.

Variables

See defaults/main.yml

Main configuration:

static_web_sites:
    "portfolio.example.fr":
        git_repo: "https://github.com/example/portfolio.git"
        git_branch: "main" # Optional, defaults to main
        git_depth: 1 # Optional, shallow clone
        build_command: "npm install && npm run build" # Optional
        root_dir: "dist" # Optional, serve subdirectory
        ssl_enabled: true # Optional, defaults to true (HTTPS)

    "blog.example.com":
        git_repo: "https://github.com/example/blog.git"
        # ssl_enabled defaults to true, set to false for HTTP only

Notes

  • Nginx configuration is deployed to {{ nginx_conf_dir }}/<hostname>.conf
  • Sites are owned by nginx user (www-data on Debian, http on Arch)
  • Git clones use shallow clone (depth=1) by default for efficiency
  • Build commands run as nginx user