Skip to content

Commit

Permalink
fix(exchanges): accept arguments if supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Aug 1, 2021
1 parent 52eacec commit 6df27a6
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 57 deletions.
8 changes: 4 additions & 4 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ rabbitmq:
auto_delete: 'false'
vhost: default_vhost
arguments:
- 'alternate-**exchange': 'amq.fanout'
- 'test-header': 'testing'
alternate-**exchange: 'amq.fanout'
test-header: 'testing'
remove_guest_user: true
users:
user1:
Expand Down Expand Up @@ -164,8 +164,8 @@ rabbitmq:
auto_delete: 'false'
vhost: rabbit2_vhost
arguments:
- 'alternate-**exchange': 'amq.fanout'
- 'test-header': 'testing'
alternate-**exchange: 'amq.fanout'
test-header: 'testing'
remove_guest_user: true
users:
user1:
Expand Down
3 changes: 2 additions & 1 deletion rabbitmq/config/exchanges/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ include:
rabbitmq-config-exchanges-enabled-{{ name }}-{{ exchange }}:
cmd.run:
- name: /usr/local/sbin/rabbitmqadmin --node {{ name }} --port={{ node.nodeport + 10000 }} declare exchange --vhost={{ ex.vhost }} --username={{ ex.user }} --password={{ ex.passwd }} name={{ exchange }} type={{ ex.type }} durable={{ ex.durable }} internal={{ ex.internal }} auto_delete={{ ex.auto_delete }} # noqa 204
- name: >-
/usr/local/sbin/rabbitmqadmin --node {{ name }} --port={{ node.nodeport + 10000 }} declare exchange --vhost={{ ex.vhost }} --username={{ ex.user }} --password={{ ex.passwd }} name={{ exchange }} type={{ ex.type }} durable={{ ex.durable }} internal={{ ex.internal }} auto_delete={{ ex.auto_delete }} arguments='{{ "{}" if "arguments" not in ex else ex.arguments|json }}' # noqa 204
- onlyif:
- test -x /usr/local/sbin/rabbitmqadmin
- /usr/sbin/rabbitmq-plugins --node {{ name }} is_enabled rabbitmq_management
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -155,8 +155,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/centos-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -155,8 +155,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/debian-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/debian-11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -151,8 +151,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/debian-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/fedora-32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -155,8 +155,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/fedora-33.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -155,8 +155,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/fedora-34.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -155,8 +155,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/opensuse-15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/ubuntu-16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/ubuntu-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down
8 changes: 4 additions & 4 deletions test/integration/default/files/_mapdata/ubuntu-20.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down Expand Up @@ -153,8 +153,8 @@ values:
exchanges:
my-exchange:
arguments:
- alternate-**exchange: amq.fanout
- test-header: testing
alternate-**exchange: amq.fanout
test-header: testing
auto_delete: 'false'
durable: 'true'
internal: 'false'
Expand Down

0 comments on commit 6df27a6

Please sign in to comment.