summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml4
-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
-rw-r--r--deploy/adapters/ansible/roles/database/templates/replica.js2
-rw-r--r--deploy/adapters/ansible/roles/database/templates/wsrep.cnf4
-rw-r--r--deploy/adapters/ansible/roles/neutron-network/tasks/main.yml8
7 files changed, 26 insertions, 20 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
index 506113a2..199c14ab 100644
--- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
+++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
@@ -77,8 +77,8 @@
- hosts: ceph_adm
remote_user: root
accelerate: true
- roles: [] # just test
- #- ceph-deploy
+ roles:
+ - ceph-deploy
- hosts: all
remote_user: root
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 }}"
diff --git a/deploy/adapters/ansible/roles/database/templates/replica.js b/deploy/adapters/ansible/roles/database/templates/replica.js
index 3282cd6a..d19db50d 100644
--- a/deploy/adapters/ansible/roles/database/templates/replica.js
+++ b/deploy/adapters/ansible/roles/database/templates/replica.js
@@ -1,7 +1,7 @@
config = { _id:"compass", members:[
{% for host in haproxy_hosts.values() %}
{% set pair = '%s:27017' % host %}
- {_id:{{ loop.index0 }},host:"{{ pair }}"},
+ {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ haproxy_hosts|length - loop.index0 }}},
{% endfor %}
]
};
diff --git a/deploy/adapters/ansible/roles/database/templates/wsrep.cnf b/deploy/adapters/ansible/roles/database/templates/wsrep.cnf
index 643792ab..4dc6fb7b 100644
--- a/deploy/adapters/ansible/roles/database/templates/wsrep.cnf
+++ b/deploy/adapters/ansible/roles/database/templates/wsrep.cnf
@@ -23,7 +23,11 @@ wsrep_provider_options="gcache.size=1024M"
wsrep_cluster_name="my_wsrep_cluster"
# Group communication system handle
+{% if haproxy_hosts|length == 1 %}
+wsrep_cluster_address=gcomm://
+{% else %}
wsrep_cluster_address=gcomm://{{ haproxy_hosts.values()|join(",") }}
+{% endif %}
# Human-readable node name (non-unique). Hostname by default.
#wsrep_node_name=
diff --git a/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml b/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml
index d02747af..a3a62b11 100644
--- a/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml
@@ -23,14 +23,6 @@
failed_when: iproute_out.rc == 255
when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}"
-- name: update epel-release
- shell: yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
- ignore_errors: True
-
-- name: update rdo-release-kilo repo
- shell: yum install -y http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm
- ignore_errors: True
-
- name: install neutron network related packages
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: packages | union(packages_noarch)