Commit Graph

231 Commits

Author SHA1 Message Date
Imran Iqbal
0cd7c7b205
fix(certificates): ensure openssl installed before cmd.run
Fix failure highlighted on OpenSUSE Tumbleweed, where the `cmd.run` runs
before the `pkg.installed`:

* https://gitlab.com/saltstack-formulas/nginx-formula/-/jobs/1345325819#L2830
2021-06-14 18:31:06 +01:00
Jonathon Anderson
6cb486dbd2
fix(snippets): ignore servers or snippets when undefined
nginx.servers_config wants a lightened copy of the nginx map
to render as json; but, when it was trying to remove the
servers and snippets keys from the map it assumed their presence,
causing a KeyError if they were not present by its use of .pop().

While wrapping these in an "if" clause would likely be more
correct, along with replacing .pop() with del (if jinja even
supports that) the simplest change here is to just specify a
default value for .pop(), which obviates the KeyError.

Fixes #274
2021-06-14 16:25:23 +01:00
Javier Bértoli
494b2fbea4 fix(servers): wrong conditional specification 2021-05-12 12:09:29 -03:00
Javier Bértoli
622d22f971 feat(servers_config): add require statement to manage dependencies
Also, check config before applying
2021-04-28 09:37:34 -03:00
Imran Iqbal
4cd351adbc
fix(freebsd): add openssl pkg and update all default tests 2021-04-03 13:04:05 +01:00
Tobias Jungel
c03729ae32 fix(servers_config): fixup 05994e1 2021-03-30 01:42:27 +02:00
Tobias Jungel
3825557070 refactor(servers_config): remove unused loop 2021-03-26 21:41:22 +01:00
Tobias Jungel
05994e1b17 fix(servers_config): remove service depedency
* servers_config should run without service dependency. Service is
  managed in servers.sls.
* dropped nginx_service_reload in favor of extending nginx_service
* wait for all file states (create and delete)
* create dirs for symlinked files
2021-03-26 21:40:33 +01:00
Imran Iqbal
8ea3c82be3
test: standardise use of share suite & _mapdata state [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/302
2021-03-23 21:30:37 +00:00
Javier Bértoli
7271c9d16c fix(passenger): various fixes
* correctly set dependencies in configuration
* update RPM repo key
* add tests for passenger installation as nginx module
* update test matrix
2021-03-11 13:35:24 -03:00
Javier Bértoli
b396b24fe4 feat(config): validate config before applying 2021-03-11 13:27:14 -03:00
Imran Iqbal
ae6375cccc
fix(pkg): add inline EPEL repo configuration for Amazon Linux 2 2021-02-14 08:24:15 +00:00
sticky-note
8641f0d79a feat(context): pass nginx to snippets and server_config contexts 2020-12-17 13:52:46 +11:00
Imran Iqbal
66f4ea7ed9 style(libtofs.jinja): use Black-inspired Jinja formatting [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/237
2020-07-19 23:27:21 +01:00
fthenard
a373bdab79 feat(add purge option): purge sites option 2020-03-30 14:52:05 +02:00
Imran Iqbal
10b446ed1e fix(libtofs): “files_switch” mess up the variable exported by “map.jinja” [skip ci]
* Checked using https://github.com/myii/ssf-formula/pull/131
2020-02-14 19:10:08 +00:00
Imran Iqbal
49caf8cd69
fix(map.jinja): use upstream default for worker_connections
* Close #261
* https://nginx.org/en/docs/ngx_core_module.html#worker_connections
2019-12-22 15:01:03 +00:00
Imran Iqbal
297e3ac400
fix(certificates.sls): prepare certificates_path dir separately
* Close #241
2019-11-22 18:45:51 +00:00
Imran Iqbal
06d055e220
fix(pkg.sls): fix salt-lint errors
```bash
Examining nginx/pkg.sls of type state
[201] Trailing whitespace
nginx/pkg.sls:149
    - gpgcheck: 0
```
2019-10-09 14:44:45 +01:00
Imran Iqbal
0772d8a8d0
fix(map.jinja): fix salt-lint errors
```bash
Examining nginx/map.jinja of type state
[202] Jinja statement should have spaces before and after: {% statement %}
nginx/map.jinja:175
})%}

[202] Jinja statement should have spaces before and after: {% statement %}
nginx/map.jinja:181
})%}

[202] Jinja statement should have spaces before and after: {% statement %}
nginx/map.jinja:188
})%}

[202] Jinja statement should have spaces before and after: {% statement %}
nginx/map.jinja:192
    })%}

[202] Jinja statement should have spaces before and after: {% statement %}
nginx/map.jinja:195
    })%}
```
2019-10-09 14:44:45 +01:00
Imran Iqbal
bedc1b6c90
fix(certificates.sls): fix salt-lint errors
```bash
Examining nginx/certificates.sls of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
nginx/certificates.sls:40
    - contents_pillar: {{salt['pillar.get']('nginx:certificates:{}:public_cert_pillar'.format(domain))}}

[202] Jinja statement should have spaces before and after: {% statement %}
nginx/certificates.sls:47
{% if salt['pillar.get']("nginx:certificates:{}:private_key".format(domain)) or salt['pillar.get']("nginx:certificates:{}:private_key_pillar".format(domain))%}

[206] Jinja variables should have spaces before and after: {{ var_name }}
nginx/certificates.sls:54
    - contents_pillar: {{salt['pillar.get']('nginx:certificates:{}:private_key_pillar'.format(domain))}}
```
2019-10-09 14:44:45 +01:00
Niels Abspoel
4be3109749
Merge pull request #246 from ErisDS/passenger-plus
Included snippets, servers & certs for passenger
2019-09-01 21:13:09 +02:00
Imran Iqbal
34af78ad40 chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.6.0)
2019-08-17 16:06:48 +01:00
N
ab6148c064
feat(linux): archlinux support (no osfinger grain) 2019-08-03 14:53:49 +01:00
Imran Iqbal
022345da76 chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.1.0-rc.2)
2019-07-25 09:37:25 +01:00
Hannah Wolfe
e07b5582dc feat(passenger): inc config, snippets, servers, etc
- currently you're forced to define extra states if you opt to install nginx with passenger,
 if you want the same outcome for passenger and nginx installs with equivalent config
- passenger is an extra module on top of nginx, makes no sense to end up with less configuration by default
2019-07-23 14:14:34 +01:00
nb
aa87721bc2 fix(snippets): removed appending of ".conf"
(...) for snippets filename.
BREAKING CHANGE: Users have to modify their pillar
according to this commit. Users MUST append '.conf' for their
existing managed snippets.
2019-06-20 00:11:31 +11:00
Sammy
d5262ea5df feat(tofs): first implemetation + tplroot
First implementation of TOFS for:
nginx_config, passenger_config, servers_config and snippets
Introduced tplroot on modified files as well
Fixed GH link of nginx.conf file in docs/TOFS_pattern.rst
Fixed test for snippets name pillar
2019-06-04 08:57:21 +11:00
Imran Iqbal
46dff1596a fix: prevent running of states deprecated in v1.0.0
* Route all to `nginx/deprecated.sls`
2019-05-13 13:06:04 +01:00
Eric Veiras Galisson
0fc507055d refactor: replace old nginx with nginx.ng
BREAKING CHANGE: all previous `nginx` based configurations must be reviewed;
`nginx.ng` usage must be promoted to `nginx` and any uses of the original
`nginx` will have to be converted.
2019-05-12 17:13:17 +01:00
Imran Iqbal
c24d2b64d4 ci(travis): fix opensuse tests 2019-04-17 11:00:23 +01:00
Eric Veiras Galisson
cfed4ce2d1 fix: corrected indentation on context in file.managed states 2019-04-11 15:02:18 +02:00
sam
0ecdee9c35 added default snippets directory for FreeBSD platform 2019-03-06 11:43:03 +11:00
N
cea121299e
Updated for Suse 15.0 2019-02-21 18:16:03 +00:00
Heinz Wiesinger
1541a59c83 Fix multiple values for the same key (include/listen) in server config file.
With this one can now also write

 - include:
   - file1
   - file2

Rather than only

 - include: file1
 - include: file2
2019-02-19 09:26:15 +01:00
Niels Abspoel
a1220edb36
Merge pull request #209 from noelmcloughlin/fixes6
Fix sites-available bug in formula logic
2019-01-25 21:50:40 +01:00
N
2356b4a989
Fix bug related to #188 2019-01-25 19:20:58 +00:00
Niels Abspoel
14572a1c3a
Merge pull request #128 from ghost/master
Fix build deps for NGINX NG build from source
2019-01-25 20:04:07 +01:00
Niels Abspoel
bd9fb88eee
Merge pull request #205 from noelmcloughlin/master
makedirs needed for 'available_dir' pillar
2019-01-25 19:51:56 +01:00
Niels Abspoel
2a97b07084
Merge pull request #206 from noelmcloughlin/fixes2
Fix #182 bug
2019-01-25 19:50:54 +01:00
Niels Abspoel
60b8e74bc0
Merge pull request #207 from noelmcloughlin/fixes3
Enforce PPA's on Ubuntu(s) only; not Debian
2019-01-25 19:50:23 +01:00
N
b6dc52444c
Enforce PPA's on Ubuntu(s) only; not Debian 2019-01-25 15:09:13 +00:00
N
e5b96c169e
Fix #182 2019-01-25 13:25:11 +00:00
N
86f0ae93eb
makedirs is important for 'available_dir' pillar 2019-01-23 22:56:22 +00:00
N
5ca0ef2446
Merge branch 'master' into unsorted_context_mappings 2019-01-23 20:16:00 +00:00
N
698f7cc724
Merge pull request #177 from Perceptyx/fix_config_require
Servers config should require available/enabled dirs
2019-01-23 20:09:15 +00:00
Bernhard M. Wiedemann
42ad7c11d8 Fix detection of systemd
on openSUSE Leap 15.0, the string was systemd.cpython-36
2018-12-20 13:19:28 +01:00
Bernhard M. Wiedemann
6f5ac946d1 Add support for SUSE OSes
like openSUSE and SLES
2018-12-20 12:37:46 +01:00
Bernhard M. Wiedemann
8c780fa63f Use home and conf_dir from map.jinja
to reduce duplication of constants
2018-12-20 12:37:03 +01:00
Niels Abspoel
355a968a2b
Merge pull request #197 from MEschenbacher/pillarcert
deploy certificates directly from pillar
2018-10-20 20:19:56 +02:00