Page MenuHomeDevCentral

Reload nginx after any configuration file is updated
ClosedPublic

Authored by dereckson on Apr 20 2017, 08:15.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 07:12
Unknown Object (File)
Tue, Dec 17, 07:39
Unknown Object (File)
Tue, Dec 17, 05:36
Unknown Object (File)
Sat, Dec 14, 10:30
Unknown Object (File)
Sat, Dec 14, 10:30
Unknown Object (File)
Sat, Dec 14, 09:46
Unknown Object (File)
Sat, Dec 14, 09:14
Unknown Object (File)
Sat, Dec 14, 07:10
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.