Browse Source

Merge pull request #119 from grobinson-blockchain/master

Auto-restart NGINX and use pillars to set conf path when building from source
susefix
Forrest 8 years ago
parent
commit
a35b606d9c
5 changed files with 11 additions and 5 deletions
  1. +4
    -2
      nginx/ng/files/nginx.service
  2. +0
    -1
      nginx/ng/map.jinja
  3. +2
    -2
      nginx/ng/src.sls
  4. +4
    -0
      nginx/ng/vhosts_config.sls
  5. +1
    -0
      pillar.example

+ 4
- 2
nginx/ng/files/nginx.service View File

PIDFile=/run/nginx.pid PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure
RestartSec=10s
PrivateTmp=true PrivateTmp=true


[Install] [Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

+ 0
- 1
nginx/ng/map.jinja View File

'source_hash': '8ed647c3dd65bc4ced03b0e0f6bf9e633eff6b01bac772bcf97077d58bc2be4d', 'source_hash': '8ed647c3dd65bc4ced03b0e0f6bf9e633eff6b01bac772bcf97077d58bc2be4d',
'source': { 'source': {
'opts': {}, 'opts': {},
'modules': {}
}, },
'package': { 'package': {
'opts': {}, 'opts': {},

+ 2
- 2
nginx/ng/src.sls View File



nginx_configure: nginx_configure:
cmd.run: cmd.run:
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf {{ nginx.source.opts | join(' ') }}
- name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }}
- cwd: /tmp/nginx-{{ nginx.source_version }} - cwd: /tmp/nginx-{{ nginx.source_version }}
- require: - require:
- archive: nginx_download - archive: nginx_download
- require: - require:
- cmd: nginx_install - cmd: nginx_install
- onchanges: - onchanges:
- cmd: nginx_install
- cmd: nginx_install

+ 4
- 0
nginx/ng/vhosts_config.sls View File

- template: jinja - template: jinja
- context: - context:
config: {{ settings.config|json() }} config: {{ settings.config|json() }}
{% if 'overwrite' in vhost and vhost.overwrite == False %}
- unless:
- test -e {{ vhost_curpath(vhost) }}
{% endif %}
{% do vhost_states.append(conf_state_id) %} {% do vhost_states.append(conf_state_id) %}
{% endif %} {% endif %}



+ 1
- 0
pillar.example View File

enabled_dir: /tmp/sites-enabled # an alternate directory (not sites-enabled) where this vhost may be found enabled_dir: /tmp/sites-enabled # an alternate directory (not sites-enabled) where this vhost may be found
disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking
enabled: True enabled: True
overwrite: True # overwrite an existing vhost file or not
# May be a list of config options or None, if None, no vhost file will be managed/templated # May be a list of config options or None, if None, no vhost file will be managed/templated
# Take server directives as lists of dictionaries. If the dictionary value is another list of # Take server directives as lists of dictionaries. If the dictionary value is another list of

Loading…
Cancel
Save