File tree 6 files changed +21
-18
lines changed
6 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 2
2
# vim: ft=sls
3
3
4
4
include:
5
- - .users.clean
6
- - .vhosts.clean
7
- - .exchanges.clean
5
+ - .parameters.clean
6
+ - .policies.clean
8
7
- .bindings.clean
8
+ - .exchanges.clean
9
9
- .queues.clean
10
- - .policies.clean
11
- - .plugins.clean
12
- - .parameters.clean
10
+ - .vhosts.clean
13
11
- .clusters.clean
12
+ - .users.clean
13
+ - .plugins.clean
14
14
- .files.clean
Original file line number Diff line number Diff line change 5
5
{%- from tplroot ~ " /map.jinja" import mapdata as rabbitmq with context % }
6
6
7
7
{%- for name, node in rabbitmq.nodes.items() % }
8
- {%- if ' clustered' in node and node.clustered and ' join_node ' in node % }
8
+ {%- if ' clustered' in node and node.clustered % }
9
9
10
- rabbitmq- config- clusters- {{ name }}- leave - {{ node.join_node }} :
10
+ rabbitmq- config- clusters- {{ name }}- reset :
11
11
cmd.run:
12
12
- names:
13
13
- / usr/ sbin/ rabbitmqctl -- node {{ name }} stop_app || true
Original file line number Diff line number Diff line change 3
3
4
4
include:
5
5
- .files
6
- - .clusters
7
- - .users
8
6
- .vhosts
7
+ - .users
9
8
- .queues
10
9
- .policies
11
10
- .plugins
12
11
- .exchanges
13
12
- .bindings
14
13
- .parameters
14
+ - .clusters
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ rabbitmq-config-queues-delete-{{ name }}-{{ queue }}:
21
21
- name: / usr/ local/ sbin/ rabbitmqadmin -- node {{ name }} -- port= {{ node.nodeport + 10000 }} delete queue -- vhost= {{ q.vhost }} -- username= {{ q.user }} -- password= {{ q.passwd }} name= {{ queue }} || true # noqa 204
22
22
- onlyif:
23
23
- test - x / usr/ local/ sbin/ rabbitmqadmin
24
+ - test - x / usr/ sbin/ rabbitmqctl
24
25
- test - d {{ rabbitmq.dir.data }}
26
+ - / usr/ sbin/ rabbitmqctl -- node {{ name }} -- vhost= {{ q.vhost }} list_queues | grep ^ {{ queue }}\s*
25
27
- runas: rabbitmq
26
28
- require_in:
27
29
- sls: {{ sls_config_plugins_clean }}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ rabbitmq-config-queues-enabled-{{ name }}-{{ queue }}:
26
26
- sls: {{ sls_config_plugins }}
27
27
- sls: {{ sls_config_users }}
28
28
- sls: {{ sls_config_vhosts }}
29
+ - unless: / usr/ sbin/ rabbitmqctl -- node {{ name }} -- vhost= {{ q.vhost }} list_queues | grep ^ {{ queue }}\s*
29
30
30
31
{%- endfor % }
31
32
{%- endif % }
Original file line number Diff line number Diff line change @@ -19,17 +19,17 @@ rabbitmq-config-users-added-{{ name }}-{{ user }}:
19
19
cmd.run:
20
20
- names:
21
21
- {{ cmd }} -- node {{ name }} add_user {{ user }} {{ u.password }} || true
22
- {%- if ' force' in u and u.force % }
22
+ {%- if ' force' in u and u.force % }
23
23
- {{ cmd }} -- node {{ name }} change_password {{ user }} {{ u.password }}
24
- {%- endif % }
25
- {%- if ' tags' in u and u.tags % }
24
+ {%- endif % }
25
+ {%- if ' tags' in u and u.tags % }
26
26
- {{ cmd }} -- node {{ name }} set_user_tags {{ user }} {{ u.tags| join(' ' ) }} # noqa 204
27
- {%- endif % }
28
- {%- if ' perms' in u and u.perms % }
29
- {%- for vhost, perms in u.perms.items() % }
27
+ {%- endif % }
28
+ {%- if ' perms' in u and u.perms % }
29
+ {%- for vhost, perms in u.perms.items() % }
30
30
- {{ cmd }} -- node {{ name }} set_permissions - p {{ vhost }} {{ user }} {{ perms| map (" json" )| join(" " ) }} # noqa 204
31
- {%- endfor % }
32
- {%- endif % }
31
+ {%- endfor % }
32
+ {%- endif % }
33
33
- onlyif: test - x {{ cmd }}
34
34
- runas: rabbitmq
35
35
- require:
You can’t perform that action at this time.
0 commit comments