diff options
| author | Dmitry Mescheryakov <dmescheryakov@mirantis.com> | 2015-12-09 17:02:21 +0300 |
|---|---|---|
| committer | Dmitry Mescheryakov <dmescheryakov@mirantis.com> | 2015-12-09 18:47:41 +0300 |
| commit | 7d3055a5052e073c2a7beda3b38b717715f21f10 (patch) | |
| tree | d6ab095f2b9dd192c1e9926b53d93a5c63601651 /packaging/common | |
| parent | 1be1da575bfdcd01d8c674b7c359f807f1e3e723 (diff) | |
| download | rabbitmq-server-git-7d3055a5052e073c2a7beda3b38b717715f21f10.tar.gz | |
Allow users to define poliies and parameters in OCF script for HA
By mistake OpenStack policies were copied into the initial version of
the script. The policies are removed by this change.
Instead users are provided with ability to set their own policies in
a new set_rabbitmq_policy.sh file. Also now users can extend
parameters list with their own ones. For now extended parameters can
be used only in the policy file, but later new places to hook into
could appear.
Diffstat (limited to 'packaging/common')
| -rwxr-xr-x | packaging/common/rabbitmq-server-ha.ocf | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/packaging/common/rabbitmq-server-ha.ocf b/packaging/common/rabbitmq-server-ha.ocf index 66c640c9f1..223e27f6f4 100755 --- a/packaging/common/rabbitmq-server-ha.ocf +++ b/packaging/common/rabbitmq-server-ha.ocf @@ -13,6 +13,9 @@ # # See usage() function below for more details ... # +# Note that the script uses set_rabbitmq_policy.sh script located in the +# same directory to setup RabbitMQ policies. +# ####################################################################### # Initialization: @@ -92,6 +95,11 @@ UEND } meta_data() { + # The EXTENDED_OCF_PARAMS parameter below does not exist by default + # and hence converted to an empty string unless overridden. It + # could be used by an extention script to add new parameters. For + # example see https://review.openstack.org/#/c/249180/10 + cat <<END <?xml version="1.0"?> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> @@ -268,6 +276,8 @@ If too many timeouts happen in a raw, the monitor call will return with error. <content type="string" default="${OCF_RESKEY_max_rabbitmqctl_timeouts_default}" /> </parameter> +$EXTENDED_OCF_PARAMS + </parameters> <actions> @@ -1721,11 +1731,10 @@ action_promote() { ocf_log info "${LH} action end." exit $OCF_FAILED_MASTER fi - ocf_log info "${LH} Setting HA policy for all queues" - ${OCF_RESKEY_ctl} set_policy ha-all "." '{"ha-mode":"all", "ha-sync-mode":"automatic"}' --apply-to all --priority 0 - ${OCF_RESKEY_ctl} set_policy heat_rpc_expire "^heat-engine-listener\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 - ${OCF_RESKEY_ctl} set_policy results_expire "^results\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 - ${OCF_RESKEY_ctl} set_policy tasks_expire "^tasks\\." '{"expires":3600000,"ha-mode":"all","ha-sync-mode":"automatic"}' --apply-to all --priority 1 + + local set_policy_path="$(dirname $0)/set_rabbitmq_policy.sh" + . $set_policy_path + # create timestamp file ocf_log info "${LH} Updating start timestamp" ocf_run crm_attribute -N $THIS_PCMK_NODE -l reboot --name 'rabbit-start-time' --update $(now) |
