diff --git a/kitchen.yml b/kitchen.yml index b12cd952..35195ec3 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -419,6 +419,7 @@ suites: '*': - rabbitmq._mapdata - states.files + - rabbitmq.clean - rabbitmq pillars: top.sls: diff --git a/rabbitmq/config/plugin/clean.sls b/rabbitmq/config/plugin/clean.sls index e0b34a4e..986891f9 100644 --- a/rabbitmq/config/plugin/clean.sls +++ b/rabbitmq/config/plugin/clean.sls @@ -3,10 +3,6 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_service_running = tplroot ~ '.service.running' %} - -include: - - {{ sls_service_running }} {%- if 'plugin' in rabbitmq and rabbitmq.plugin is mapping %} {%- for name in rabbitmq.plugin %} @@ -15,8 +11,6 @@ rabbitmq-config-plugin-disabled-{{ name }}: rabbitmq_plugin.disabled: - name: {{ name }} - runas: {{ rabbitmq.plugin[name]['runas'] }} - - watch_in: - - sls: {{ sls_package_clean }} {%- endfor %} {%- endif %} diff --git a/rabbitmq/config/policy/clean.sls b/rabbitmq/config/policy/clean.sls index e409d4b8..c052f0ed 100644 --- a/rabbitmq/config/policy/clean.sls +++ b/rabbitmq/config/policy/clean.sls @@ -3,10 +3,6 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_package_clean = tplroot ~ '.package.clean' %} - -include: - - {{ sls_package_clean }} {% for name in rabbitmq.policy %} @@ -14,7 +10,5 @@ rabbitmq-config-policy-absent-{{ name }}: rabbitmq_policy.absent: - name: {{ name }} - onlyif: test -x {{ rabbitmq.dir.base }}/bin/rabbitmq-env - - require_in: - - sls: {{ sls_package_clean }} {% endfor %} diff --git a/rabbitmq/config/queue/clean.sls b/rabbitmq/config/queue/clean.sls index 687fd3a5..99f65ce0 100644 --- a/rabbitmq/config/queue/clean.sls +++ b/rabbitmq/config/queue/clean.sls @@ -3,17 +3,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_service_running = tplroot ~ '.service.running' %} - -include: - - {{ sls_service_running }} {% for name, q in salt["pillar.get"]("rabbitmq:queue", {}).items() %} rabbitmq-config-queue-absent-{{ name }}: cmd.run: - name: /usr/local/sbin/rabbitmqadmin delete queue --vhost={{ q.vhost }} --username={{ q.user }} --password={{ q.passwd }} name={{ name }} # noqa 204 - - require: - - service: rabbitmq-service-running-service-running {% endfor %} diff --git a/rabbitmq/config/upstream/clean.sls b/rabbitmq/config/upstream/clean.sls index bd9c74c6..29cd68c6 100644 --- a/rabbitmq/config/upstream/clean.sls +++ b/rabbitmq/config/upstream/clean.sls @@ -3,17 +3,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_package_clean = tplroot ~ '.package.clean' %} - -include: - - {{ sls_package_clean }} {% for name in rabbitmq.upstream %} rabbitmq-config-upstream-absent-{{ name }}: rabbitmq_upstream.absent: - name: {{ name }} - - require_in: - - sls: {{ sls_package_clean }} {% endfor %} diff --git a/rabbitmq/config/user/clean.sls b/rabbitmq/config/user/clean.sls index 7f0560bf..7612d77a 100644 --- a/rabbitmq/config/user/clean.sls +++ b/rabbitmq/config/user/clean.sls @@ -3,10 +3,6 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_package_clean = tplroot ~ '.package.clean' %} - -include: - - {{ sls_package_clean }} {% for name, user in salt["pillar.get"]("rabbitmq:user", {}).items() %} @@ -14,7 +10,5 @@ rabbitmq-config-user-absent-{{ name }}: rabbitmq_user.absent: - name: {{ name }} - onlyif: test -x {{ rabbitmq.dir.base }}/bin/rabbitmq-env - - require_in: - - sls: {{ sls_package_clean }} {% endfor %} diff --git a/rabbitmq/config/vhost/clean.sls b/rabbitmq/config/vhost/clean.sls index 9a5e79f3..f4eb47b9 100644 --- a/rabbitmq/config/vhost/clean.sls +++ b/rabbitmq/config/vhost/clean.sls @@ -3,10 +3,6 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import mapdata as rabbitmq with context %} -{%- set sls_package_clean = tplroot ~ '.package.clean' %} - -include: - - {{ sls_package_clean }} {% for name in rabbitmq.vhost %} @@ -14,7 +10,5 @@ rabbitmq-config-vhost-absent-{{ name }}: rabbitmq_vhost.absent: - name: {{ name }} - onlyif: test -x {{ rabbitmq.dir.base }}/bin/rabbitmq-env - - require_in: - - sls: {{ sls_package_clean }} {% endfor %} diff --git a/rabbitmq/service/clean.sls b/rabbitmq/service/clean.sls index 855f0818..96188465 100644 --- a/rabbitmq/service/clean.sls +++ b/rabbitmq/service/clean.sls @@ -13,3 +13,5 @@ rabbitmq-service-clean-service-dead: - name: {{ rabbitmq.service.name }} - enable: False - sig: 'rabbit boot' + - require_in: + - sls: {{ sls_package_clean }}