Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Allow for no default config to be generated #234

@BenBE

Description

@BenBE

The created (and activate) default site (cf. defaults/main.yml) causes interference with configurations where the default host should be configured using a template (either cause a warning about duplicate sites or need to unconfigure things coming from the defaults). Would be nice if there was a simple way to suppress creation of the default site in cases I really want just a bare nginx with only the settings visible in my playbook.

Sample:

    - role: service.nginx
      nginx_sites:
        foo:
          template: foo.conf.j2
          server_name: foo.example.org

Expected behaviour:
Produces only one site (enabled) named foo.

Actual behaviour:
Produces two sites (enabled) called default and foo.

Workaround:

    - role: service.nginx
      keep_only_specified: true
      nginx_remove_sites:
        - default
      nginx_disabled_sites:
        - default
      nginx_sites:
        foo:
          template: foo.conf.j2
          server_name: foo.example.org

NB: Only removing default, without disabling it causes a templating error.

Alternatively /causing a warning on execution) you could override default:

    - role: service.nginx
      nginx_sites:
        default:
          template: foo.conf.j2
          server_name: foo.example.org

Possible desired config:

    - role: service.nginx
      suppress_default_site: true
      nginx_sites:
        foo:
          template: foo.conf.j2
          server_name: foo.example.org

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions