summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/tasks
diff options
context:
space:
mode:
authorcarey.xu <carey.xuhan@huawei.com>2015-12-30 14:37:12 +0800
committercarey xu <carey.xuhan@huawei.com>2015-12-31 07:41:09 +0000
commit8810e8a18e59e3c23fbd3e583fe6e347158ef464 (patch)
tree02812077ee339d80510ad704c902937639f1d6f8 /deploy/adapters/ansible/roles/database/tasks
parentbb77d2e1d5a41da912b8d3a09c825d74ead18cb1 (diff)
bugfix: uncomment ceph-deploy
JIRA: COMPASS-229 Change-Id: I35fe51c5c48838f7a16338459a50807a4c193697 Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/database/tasks')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/main.yml1
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml3
-rwxr-xr-xdeploy/adapters/ansible/roles/database/tasks/mongodb_config.yml24
3 files changed, 19 insertions, 9 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/main.yml b/deploy/adapters/ansible/roles/database/tasks/main.yml
index 314a85bd..969ee4d6 100644
--- a/deploy/adapters/ansible/roles/database/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/main.yml
@@ -3,7 +3,6 @@
- include: mariadb_install.yml
- include: mariadb_cluster.yml
- when: '{{ haproxy_hosts|length }} > 1'
- include: mariadb_config.yml
when:
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
index 35ee5858..e0afcaec 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml
@@ -30,5 +30,4 @@
service:
name: mysql
state: restarted
- when:
- - inventory_hostname == haproxy_hosts.keys()[0]
+ when: inventory_hostname == haproxy_hosts.keys()[0] and haproxy_hosts|length > 1
diff --git a/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml
index 321c38d5..e3a68c55 100755
--- a/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mongodb_config.yml
@@ -1,8 +1,11 @@
---
-- name: copy replica js
+- name: copy mongo js
template:
- src: replica.js
- dest: /opt/replica.js
+ src: '{{ item.src }}'
+ dest: '{{ item.dest }}'
+ with_items:
+ - src: replica.js
+ dest: /opt/replica.js
- name: init replica servers
shell: mongo compass /opt/replica.js
@@ -10,7 +13,16 @@
- name: wait replica servers are ready
shell: mongo compass --eval 'printjson(rs.status())'|grep -E 'PRIMARY|SECONDARY'|wc -l
register: servers
- until: servers.stdout|int == 3
+ until: servers.stdout|int == {{ haproxy_hosts|length }}
+ retries: 60
+ delay: 10
+
+- debug: msg='{{ servers.stdout |int }}'
+
+- name: wait replica servers are ready
+ shell: mongo compass --eval 'printjson(rs.status())'|grep -E 'PRIMARY'|wc -l
+ register: servers
+ until: servers.stdout|int == 1
retries: 60
delay: 10
@@ -18,7 +30,7 @@
- name: create mongodb user and db
mongodb_user:
- login_host: "{{ internal_vip.ip }}"
+ login_host: "{{ internal_ip }}"
database: ceilometer
name: ceilometer
password: "{{ CEILOMETER_DBPASS }}"
@@ -27,7 +39,7 @@
- name: grant user privilege
mongodb_user:
- login_host: "{{ internal_vip.ip }}"
+ login_host: "{{ internal_ip }}"
database: ceilometer
name: ceilometer
password: "{{ CEILOMETER_DBPASS }}"