All modern openSUSE releases (Leap 15.x, Tumbleweed) ship nginx in the
default repositories. The devel repository should not be used unless the
user knows what they are doing.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Don't require `enabled: true` - helps distributions without
separate available/enabled directories and prevents error:
"Rendering SLS 'production:nginx.servers' failed: Jinja variable 'list
object' has no attribute 'enabled'"
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
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
* 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
```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
})%}
```
```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))}}
```
- 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
(...) for snippets filename.
BREAKING CHANGE: Users have to modify their pillar
according to this commit. Users MUST append '.conf' for their
existing managed snippets.
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
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.