Merge "Configure the rabbitmq ha policy in config file"
This commit is contained in:
commit
fdca053c35
@ -14,7 +14,7 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- "rabbitmq"
|
- "rabbitmq"
|
||||||
|
|
||||||
- name: Copying over rabbitmq*.conf
|
- name: Copying over rabbitmq configs
|
||||||
template:
|
template:
|
||||||
src: "{{ item }}.j2"
|
src: "{{ item }}.j2"
|
||||||
dest: "{{ node_config_directory }}/rabbitmq/{{ item }}"
|
dest: "{{ node_config_directory }}/rabbitmq/{{ item }}"
|
||||||
@ -22,3 +22,4 @@
|
|||||||
- "rabbitmq-env.conf"
|
- "rabbitmq-env.conf"
|
||||||
- "rabbitmq.config"
|
- "rabbitmq.config"
|
||||||
- "rabbitmq-clusterer.config"
|
- "rabbitmq-clusterer.config"
|
||||||
|
- "definitions.json"
|
||||||
|
14
ansible/roles/rabbitmq/templates/definitions.json.j2
Normal file
14
ansible/roles/rabbitmq/templates/definitions.json.j2
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"vhosts": [
|
||||||
|
{"name": "/"}
|
||||||
|
],
|
||||||
|
"users": [
|
||||||
|
{"name": "{{ rabbitmq_user }}", "password": "{{ rabbitmq_password }}", "tags": "administrator"}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{"user": "{{ rabbitmq_user }}", "vhost": "/", "configure": ".*", "write": ".*", "read": ".*"}
|
||||||
|
],
|
||||||
|
"policies":[
|
||||||
|
{"vhost": "/", "name": "ha-all", "pattern": ".*", "apply-to": "all", "definition": {"ha-mode":"all"}, "priority":0}
|
||||||
|
]
|
||||||
|
}
|
@ -8,15 +8,14 @@
|
|||||||
{tcp_listeners, [
|
{tcp_listeners, [
|
||||||
{"{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}", {{ rabbitmq_port }}}
|
{"{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}", {{ rabbitmq_port }}}
|
||||||
]},
|
]},
|
||||||
{default_user, <<"{{ rabbitmq_user }}">>},
|
|
||||||
{default_pass, <<"{{ rabbitmq_password }}">>},
|
|
||||||
{cluster_partition_handling, autoheal}
|
{cluster_partition_handling, autoheal}
|
||||||
]},
|
]},
|
||||||
{rabbitmq_management, [
|
{rabbitmq_management, [
|
||||||
{listener, [
|
{listener, [
|
||||||
{ip, "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"},
|
{ip, "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"},
|
||||||
{port, {{ rabbitmq_management_port }}}
|
{port, {{ rabbitmq_management_port }}}
|
||||||
]}
|
]},
|
||||||
|
{load_definitions, "/etc/rabbitmq/definitions.json"}
|
||||||
]},
|
]},
|
||||||
{rabbitmq_clusterer, [{config, "/etc/rabbitmq/rabbitmq-clusterer.config"}]}
|
{rabbitmq_clusterer, [{config, "/etc/rabbitmq/rabbitmq-clusterer.config"}]}
|
||||||
].
|
].
|
||||||
|
@ -18,6 +18,12 @@
|
|||||||
"dest": "/etc/rabbitmq/rabbitmq-clusterer.config",
|
"dest": "/etc/rabbitmq/rabbitmq-clusterer.config",
|
||||||
"owner": "rabbitmq",
|
"owner": "rabbitmq",
|
||||||
"perm": "0600"
|
"perm": "0600"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/definitions.json",
|
||||||
|
"dest": "/etc/rabbitmq/definitions.json",
|
||||||
|
"owner": "rabbitmq",
|
||||||
|
"perm": "0600"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user