Skip to content

Commit fb6c73b

Browse files
committed
Add job to create exchanges automatically
1 parent c5ba6f6 commit fb6c73b

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: rabbit-create-exchanges
2+
3+
container_image: tutum/curl
4+
container_tag: "latest"
5+
6+
advance_arg: true
7+
8+
container_run_args: >
9+
curl -o exchanges.txt https://gist.githubusercontent.com/thejsj/a9d32a8c01cdd12e8e8e7e09b58935c4/raw/e37d7d7b8942120b30d1ba82f65173b8f16f112a/gistfile1.txt &&
10+
EXCHANGES=$(cat exchanges.txt) &&
11+
echo 'Exchanges: $EXCHANGES' &&
12+
for exchange in $EXCHANGES; do curl -i -u {{ rabbit_username }}:{{ rabbit_password }} -H 'content-type:application/json' -XPUT -d '{\"type\":\"fanout\",\"auto_delete\":false,\"durable\":true,\"arguments\":[]}' http://rabbitmq:15672/api/exchanges/%2f/$exchange; done &&
13+
echo Finished
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- hosts: rabbitmq
3+
vars_files:
4+
- group_vars/alpha-rabbit-create-exchanges.yml
5+
roles:
6+
- role: k8-job

0 commit comments

Comments
 (0)