Page MenuHomeDevCentral

Allow to use _default.conf for PaaS Docker nginx vhost
ClosedPublic

Authored by dereckson on Apr 2 2023, 13:11.
Tags
None
Referenced Files
F3775607: D2968.id7571.diff
Sun, Nov 24, 19:03
F3775606: D2968.id7570.diff
Sun, Nov 24, 19:03
F3775605: D2968.id7569.diff
Sun, Nov 24, 19:03
F3775465: D2968.id.diff
Sun, Nov 24, 18:46
F3775284: D2968.diff
Sun, Nov 24, 17:58
F3774846: D2968.diff
Sun, Nov 24, 14:20
Unknown Object (File)
Fri, Nov 22, 21:34
Unknown Object (File)
Fri, Nov 22, 01:57
Subscribers
None

Details

Summary

Current behavior
A _default.conf standard vhost is provided, but not directly useful
as it needs to be included to a specific <service>.conf file.

New behavior
This change detects if <service>.conf exists, and if not, fallback
to _default.conf, so services not needing a specific nginx configuration
can directly use the default one without any need to create a nginx file.

Test Plan
  • Deploy hound, check it's no-op
  • Deploy Penpot (D2597)

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.

Works like a charm for Hound:

Complector
$ salt docker-002 state.sls_id /etc/nginx/vhosts/hound/hound.conf roles/paas-docker/nginx/config test=True
docker-002:
----------
          ID: /etc/nginx/vhosts/hound/hound.conf
    Function: file.managed
      Result: None
     Comment: The file /etc/nginx/vhosts/hound/hound.conf is set to be changed
              Note: No changes made, actual changes may
              be different due to other states.
     Started: 13:24:14.878532
    Duration: 60.22 ms
     Changes:
              ----------
              diff:
                  ---
                  +++
                  @@ -34,6 +34,7 @@

                       location / {
                           proxy_pass http://localhost:44080;
                  +
                           include includes/proxy_params;
                           proxy_redirect off;
                       }

Summary for docker-002
------------
Succeeded: 1 (unchanged=1, changed=1)
Failed:    0
------------
Total states run:     1
Total run time:  60.220 ms

It's well only there the default file is used:

Complector
$ salt docker-002 state.show_sls roles/paas-docker/nginx/config --out=yaml | grep -C 4 _default.conf
  /etc/nginx/vhosts/hound/hound.conf:
    __env__: base
    __sls__: roles/paas-docker/nginx/config
    file:
    - source: salt://roles/paas-docker/nginx/files/vhosts/_default.conf
    - mode: 644
    - makedirs: true
    - template: jinja
    - context:
This revision is now accepted and ready to land.Apr 2 2023, 13:25