Page MenuHomeDevCentral

Reload nginx after any configuration file is updated
ClosedPublic

Authored by dereckson on Apr 20 2017, 08:15.
Tags
None
Referenced Files
F3113707: D955.id2437.diff
Mon, Jun 17, 03:59
Unknown Object (File)
Sun, Jun 16, 00:50
Unknown Object (File)
Sat, Jun 15, 23:58
Unknown Object (File)
Sat, Jun 15, 10:41
Unknown Object (File)
Sat, Jun 15, 00:32
Unknown Object (File)
Thu, Jun 13, 13:45
Unknown Object (File)
Mon, Jun 10, 22:20
Unknown Object (File)
Mon, Jun 10, 21:44
Subscribers
None

Details

Summary

Currently, only nginx.conf triggers a nginx reload.

Yet, we can add a new configuration file, e.g. for a new vhost
or amend an existing one, and that should trigger a reload too.

Fixes T1185.

Test Plan

Change configuration (e.g. D956) and ensure it works

Diff Detail

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

Event Timeline

When nothing changes

Salt master
$ salt eglide state.apply roles/shellserver/web-hosting/
[…]
----------
          ID: nginx_config_files
    Function: cmd.run
        Name: nginx -s reload
      Result: True
     Comment: State was not run because none of the onchanges reqs changed
     Changes:   
[…]

When a configuration file changes

Tested with D956:

Salt master
$ salt eglide state.apply roles/shellserver/web-hosting/
[…]
----------
          ID: nginx_config_files
    Function: cmd.run
        Name: nginx -s reload
      Result: True
     Comment: Command "nginx -s reload" run
     Started: 08:28:09.985663
    Duration: 76.968 ms
     Changes:   
              ----------
              pid:
                  19504
              retcode:
                  0
              stderr:
              stdout:
[…]
This revision is now accepted and ready to land.Apr 20 2017, 08:32
This revision was automatically updated to reflect the committed changes.