summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/ha
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-08-06 02:37:33 -0400
committerbaigk <baiguoku@huawei.com>2015-08-09 22:47:56 -0400
commit87612abc0e24cafd89a49e350165b08fe1608233 (patch)
tree07b156c0268fd189f92e8a0730118edc51b8073f /deploy/adapters/ansible/roles/ha
parent5aedf594112c0749b6e9039d15b9fe70d210a942 (diff)
support deployment openstack juno with ansible for compass in centos7.1
JIRA: COMPASS-6 Change-Id: I8ef865e8acfe29c3ff5c7e9030e4cebabed3457b Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/ha')
-rw-r--r--deploy/adapters/ansible/roles/ha/tasks/main.yml8
-rw-r--r--deploy/adapters/ansible/roles/ha/templates/failover.j22
-rw-r--r--deploy/adapters/ansible/roles/ha/templates/keepalived.conf1
-rw-r--r--deploy/adapters/ansible/roles/ha/vars/Debian.yml11
-rw-r--r--deploy/adapters/ansible/roles/ha/vars/RedHat.yml3
-rw-r--r--deploy/adapters/ansible/roles/ha/vars/main.yml10
6 files changed, 21 insertions, 14 deletions
diff --git a/deploy/adapters/ansible/roles/ha/tasks/main.yml b/deploy/adapters/ansible/roles/ha/tasks/main.yml
index eeaf5921..edd5e6dd 100644
--- a/deploy/adapters/ansible/roles/ha/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/ha/tasks/main.yml
@@ -3,14 +3,14 @@
- name: install keepalived xinet haproxy
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
- with_items: packages
+ with_items: packages | union(packages_noarch)
- name: generate ha service list
shell: echo {{ item }} >> /opt/service
- with_items: services
+ with_items: services | union(services_noarch)
- name: install pexpect
- pip: name=pexpect state=present
+ pip: name=pexpect state=present extra_args='--pre'
- name: activate ip_nonlocal_bind
sysctl: name=net.ipv4.ip_nonlocal_bind value=1
@@ -37,6 +37,7 @@
regexp="ENABLED=*"
line="ENABLED=1"
notify: restart haproxy
+ when: ansible_os_family == "Debian"
- name: set haproxy log
lineinfile: dest=/etc/rsyslog.conf state=present
@@ -76,6 +77,7 @@
lineinfile: dest=/etc/default/keepalived state=present
regexp="^DAEMON_ARGS=*"
line="DAEMON_ARGS=\"-D -d -S 1\""
+ when: ansible_os_family == "Debian"
- name: set keepalived log
lineinfile: dest=/etc/rsyslog.conf state=present
diff --git a/deploy/adapters/ansible/roles/ha/templates/failover.j2 b/deploy/adapters/ansible/roles/ha/templates/failover.j2
index e3877e6b..ebfa65f8 100644
--- a/deploy/adapters/ansible/roles/ha/templates/failover.j2
+++ b/deploy/adapters/ansible/roles/ha/templates/failover.j2
@@ -28,7 +28,7 @@ def ssh_get_hostname(ip):
return result.split(os.linesep)[1]
except pxssh.ExceptionPxssh as e:
LOG.error("pxssh failed on login.")
- raise
+ raise
def failover(mode):
config = ConfigParser.ConfigParser()
diff --git a/deploy/adapters/ansible/roles/ha/templates/keepalived.conf b/deploy/adapters/ansible/roles/ha/templates/keepalived.conf
index 02c55326..f9f91915 100644
--- a/deploy/adapters/ansible/roles/ha/templates/keepalived.conf
+++ b/deploy/adapters/ansible/roles/ha/templates/keepalived.conf
@@ -15,7 +15,6 @@ global_defs {
}
vrrp_instance VI_1 {
-
interface {{ INTERNAL_INTERFACE }}
virtual_router_id 51
state BACKUP
diff --git a/deploy/adapters/ansible/roles/ha/vars/Debian.yml b/deploy/adapters/ansible/roles/ha/vars/Debian.yml
index 263c2ea7..041cf477 100644
--- a/deploy/adapters/ansible/roles/ha/vars/Debian.yml
+++ b/deploy/adapters/ansible/roles/ha/vars/Debian.yml
@@ -1,10 +1,3 @@
---
-packages:
- - keepalived
- - xinetd
- - haproxy
-
-services:
- - keepalived
- - xinetd
- - haproxy
+services: []
+packages: []
diff --git a/deploy/adapters/ansible/roles/ha/vars/RedHat.yml b/deploy/adapters/ansible/roles/ha/vars/RedHat.yml
new file mode 100644
index 00000000..041cf477
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ha/vars/RedHat.yml
@@ -0,0 +1,3 @@
+---
+services: []
+packages: []
diff --git a/deploy/adapters/ansible/roles/ha/vars/main.yml b/deploy/adapters/ansible/roles/ha/vars/main.yml
new file mode 100644
index 00000000..3928b781
--- /dev/null
+++ b/deploy/adapters/ansible/roles/ha/vars/main.yml
@@ -0,0 +1,10 @@
+---
+packages_noarch:
+ - keepalived
+ - xinetd
+ - haproxy
+
+services_noarch:
+ - keepalived
+ - xinetd
+ - haproxy