diff options
author | carey.xu <carey.xuhan@huawei.com> | 2016-01-14 10:57:37 +0800 |
---|---|---|
committer | Justin chi <chigang@huawei.com> | 2016-01-14 09:15:45 +0000 |
commit | 29cebb7068e224b735003584d2c57bc3e152035c (patch) | |
tree | 281efeed547b6cbacfc2b99b502d7c136f6a72cd /deploy/adapters/ansible/roles | |
parent | 0524cb673fbd9ff31db79f885f4a319ec96e2cc3 (diff) |
bugfix: mongodb's priority should consistent with keepalived for failover
JIRA: COMPASS-260
Change-Id: Iafb2f3a853fe05ac12a3275737f5edd1b987ffdd
Signed-off-by: carey.xu <carey.xuhan@huawei.com>
(cherry picked from commit b51e9555fb11e2d24e555a9122b810694bbd77ee)
Diffstat (limited to 'deploy/adapters/ansible/roles')
-rwxr-xr-x | deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml | 4 | ||||
-rw-r--r-- | deploy/adapters/ansible/roles/database/templates/replica.js | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml index e3a68c55..3e7fe5f7 100755 --- a/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml +++ b/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml @@ -30,7 +30,7 @@ - name: create mongodb user and db mongodb_user: - login_host: "{{ internal_ip }}" + login_host: "{{ internal_vip.ip }}" database: ceilometer name: ceilometer password: "{{ CEILOMETER_DBPASS }}" @@ -39,7 +39,7 @@ - name: grant user privilege mongodb_user: - login_host: "{{ internal_ip }}" + login_host: "{{ internal_vip.ip }}" database: ceilometer name: ceilometer password: "{{ CEILOMETER_DBPASS }}" diff --git a/deploy/adapters/ansible/roles/database/templates/replica.js b/deploy/adapters/ansible/roles/database/templates/replica.js index dd5fc575..7e7072ff 100644 --- a/deploy/adapters/ansible/roles/database/templates/replica.js +++ b/deploy/adapters/ansible/roles/database/templates/replica.js @@ -1,8 +1,8 @@ config = { _id:"compass", members:[ -{% for host in haproxy_hosts.values() %} +{% for hostname, host in haproxy_hosts.items() %} {% set pair = '%s:27017' % host %} - {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[inventory_hostname] + 1 }}}, -{% endfor %} -] + {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[hostname] + 1 }}}, + {% endfor %} + ] }; rs.initiate(config); |