Skip to content

Commit

Permalink
chore(clean): remove requires from config clean states
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jul 8, 2021
1 parent f9ef575 commit 251ed20
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 36 deletions.
1 change: 1 addition & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ suites:
'*':
- rabbitmq._mapdata
- states.files
- rabbitmq.clean
- rabbitmq
pillars:
top.sls:
Expand Down
6 changes: 0 additions & 6 deletions rabbitmq/config/plugin/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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 %}
6 changes: 0 additions & 6 deletions rabbitmq/config/policy/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

{%- 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 %}
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 %}
6 changes: 0 additions & 6 deletions rabbitmq/config/queue/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
6 changes: 0 additions & 6 deletions rabbitmq/config/upstream/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
6 changes: 0 additions & 6 deletions rabbitmq/config/user/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

{%- 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() %}
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 %}
6 changes: 0 additions & 6 deletions rabbitmq/config/vhost/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

{%- 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 %}
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 %}
2 changes: 2 additions & 0 deletions rabbitmq/service/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ rabbitmq-service-clean-service-dead:
- name: {{ rabbitmq.service.name }}
- enable: False
- sig: 'rabbit boot'
- require_in:
- sls: {{ sls_package_clean }}

0 comments on commit 251ed20

Please sign in to comment.