From 172e270e721973fe43444880fee14eba97745750 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 13 May 2019 05:30:09 +0100 Subject: [PATCH] fix: prevent running of states deprecated in `v1.0.0` * Route all to `nginx/deprecated.sls` --- nginx/common.sls | 2 ++ nginx/deprecated.sls | 32 ++++++++++++++++++++++++++++++++ nginx/init.sls | 15 +++++++++------ nginx/luajit2.sls | 2 ++ nginx/ng/certificates.sls | 2 ++ nginx/ng/config.sls | 2 ++ nginx/ng/init.sls | 2 ++ nginx/ng/passenger.sls | 2 ++ nginx/ng/pkg.sls | 2 ++ nginx/ng/servers.sls | 2 ++ nginx/ng/servers_config.sls | 2 ++ nginx/ng/service.sls | 2 ++ nginx/ng/snippets.sls | 2 ++ nginx/ng/src.sls | 2 ++ nginx/openresty.sls | 2 ++ nginx/package.sls | 2 ++ nginx/source.sls | 2 ++ nginx/sysvinit.sls | 2 ++ nginx/upstart.sls | 2 ++ nginx/users.sls | 2 ++ 20 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 nginx/common.sls create mode 100644 nginx/deprecated.sls create mode 100644 nginx/luajit2.sls create mode 100644 nginx/ng/certificates.sls create mode 100644 nginx/ng/config.sls create mode 100644 nginx/ng/init.sls create mode 100644 nginx/ng/passenger.sls create mode 100644 nginx/ng/pkg.sls create mode 100644 nginx/ng/servers.sls create mode 100644 nginx/ng/servers_config.sls create mode 100644 nginx/ng/service.sls create mode 100644 nginx/ng/snippets.sls create mode 100644 nginx/ng/src.sls create mode 100644 nginx/openresty.sls create mode 100644 nginx/package.sls create mode 100644 nginx/source.sls create mode 100644 nginx/sysvinit.sls create mode 100644 nginx/upstart.sls create mode 100644 nginx/users.sls diff --git a/nginx/common.sls b/nginx/common.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/common.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/deprecated.sls b/nginx/deprecated.sls new file mode 100644 index 00000000..6c2c8260 --- /dev/null +++ b/nginx/deprecated.sls @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# vim: ft=sls + +nginx-deprecated-in-v1.0.0-test-fail: + test.fail_without_changes: + - name: | + + + ################################################################################ + # # + # WARNING: BREAKING CHANGES SINCE `v1.0.0` # + # # + ################################################################################ + # # + # Prior to `v1.0.0`, this formula provided two methods for managing NGINX; the # + # old method under `nginx` and the new method under `nginx.ng`. The old method # + # has now been removed and `nginx.ng` has been promoted to be `nginx` in its # + # place. # + # # + # If you are not in a position to migrate, please pin your repo to the final # + # release tag before `v1.0.0`, i.e. `v0.56.1`. # + # # + # To migrate from `nginx.ng`, simply modify your pillar to promote the entire # + # section under `nginx:ng` so that it is under `nginx` instead. So with the # + # editor of your choice, highlight the entire section and then unindent one # + # level. Finish by removing the `ng:` line. # + # # + # To migrate from the old `nginx`, first convert to `nginx.ng` under `v0.56.1` # + # and then follow the steps laid out in the paragraph directly above. # + # # + ################################################################################ + - failhard: True diff --git a/nginx/init.sls b/nginx/init.sls index 1898baba..7ad31bd2 100644 --- a/nginx/init.sls +++ b/nginx/init.sls @@ -2,14 +2,17 @@ # # Meta-state to fully install nginx. -{% from 'nginx/map.jinja' import nginx, sls_block with context %} +{%- from 'nginx/map.jinja' import nginx, sls_block with context %} include: + {%- if nginx.ng is defined %} + - nginx.deprecated + {%- endif %} - nginx.config - nginx.service - {% if nginx.snippets is defined %} + {%- if nginx.snippets is defined %} - nginx.snippets - {% endif %} + {%- endif %} - nginx.servers - nginx.certificates @@ -23,8 +26,8 @@ extend: nginx_config: file: - require: - {% if nginx.install_from_source %} + {%- if nginx.install_from_source %} - cmd: nginx_install - {% else %} + {%- else %} - pkg: nginx_install - {% endif %} + {%- endif %} diff --git a/nginx/luajit2.sls b/nginx/luajit2.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/luajit2.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/certificates.sls b/nginx/ng/certificates.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/certificates.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/config.sls b/nginx/ng/config.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/config.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/init.sls b/nginx/ng/init.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/init.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/passenger.sls b/nginx/ng/passenger.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/passenger.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/pkg.sls b/nginx/ng/pkg.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/pkg.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/servers.sls b/nginx/ng/servers.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/servers.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/servers_config.sls b/nginx/ng/servers_config.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/servers_config.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/service.sls b/nginx/ng/service.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/service.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/snippets.sls b/nginx/ng/snippets.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/snippets.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/ng/src.sls b/nginx/ng/src.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/ng/src.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/openresty.sls b/nginx/openresty.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/openresty.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/package.sls b/nginx/package.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/package.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/source.sls b/nginx/source.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/source.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/sysvinit.sls b/nginx/sysvinit.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/sysvinit.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/upstart.sls b/nginx/upstart.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/upstart.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated diff --git a/nginx/users.sls b/nginx/users.sls new file mode 100644 index 00000000..1999cba1 --- /dev/null +++ b/nginx/users.sls @@ -0,0 +1,2 @@ +include: + - nginx.deprecated