summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible
diff options
context:
space:
mode:
authorshuai chen <chenshuai@huawei.com>2015-09-12 08:40:59 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-09-12 08:40:59 +0000
commit86af3f1897f0cc9b1231e6cbd9e302f5daf3f64c (patch)
tree2c955b0c27d0c4175bce21671da0ac88fc76f465 /deploy/adapters/ansible
parent33bef552fb600e8f82cdfceb401337e2fa96553a (diff)
parent6fec88cd73e388a14dcfdad812781667e5f9a668 (diff)
Merge "bug fix:support centos 7.1 deployment"
Diffstat (limited to 'deploy/adapters/ansible')
-rw-r--r--deploy/adapters/ansible/roles/database/vars/RedHat.yml2
-rw-r--r--deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh7
-rw-r--r--deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh8
-rw-r--r--deploy/adapters/ansible/roles/monitor/tasks/main.yml8
-rw-r--r--deploy/adapters/ansible/roles/monitor/vars/Debian.yml4
-rw-r--r--deploy/adapters/ansible/roles/monitor/vars/RedHat.yml3
-rw-r--r--deploy/adapters/ansible/roles/neutron-network/vars/RedHat.yml2
7 files changed, 29 insertions, 5 deletions
diff --git a/deploy/adapters/ansible/roles/database/vars/RedHat.yml b/deploy/adapters/ansible/roles/database/vars/RedHat.yml
index 12eedf51..7213d7fa 100644
--- a/deploy/adapters/ansible/roles/database/vars/RedHat.yml
+++ b/deploy/adapters/ansible/roles/database/vars/RedHat.yml
@@ -1,6 +1,6 @@
---
mysql_packages:
- - python-mysqldb
+ - MySQL-python
- mysql-server
maridb_packages:
diff --git a/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh b/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh
new file mode 100644
index 00000000..0138100c
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+services=`cat /opt/service | uniq`
+for service in $services; do
+ if [ `/sbin/initctl list|awk '/stop\/waiting/{print $1}'|uniq | grep $service` ]; then
+ /sbin/start $service
+ fi
+done
diff --git a/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh b/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh
new file mode 100644
index 00000000..0fd921f4
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+services=`cat /opt/service | uniq`
+for service in $services; do
+ /usr/sbin/service $service status >/dev/null 2>&1
+ if [[ $? -ne 0 ]]; then
+ /usr/sbin/service $service start
+ fi
+done
diff --git a/deploy/adapters/ansible/roles/monitor/tasks/main.yml b/deploy/adapters/ansible/roles/monitor/tasks/main.yml
index e5b93f39..6e446944 100644
--- a/deploy/adapters/ansible/roles/monitor/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/monitor/tasks/main.yml
@@ -1,11 +1,13 @@
---
+- include_vars: "{{ ansible_os_family }}.yml"
+
- name: copy service check file
- copy: src=check_service.sh dest=/usr/local/bin/check_service.sh mode=0777
+ copy: src=check_{{ ansible_os_family }}_service.sh dest=/usr/local/bin/check_service.sh mode=0777
- name: copy cron file
- copy: src=root dest=/var/spool/cron/crontabs/root mode=0600
+ copy: src=root dest={{ cron_path }}/root mode=0600
- name: restart cron
- service: name=cron state=restarted
+ service: name={{ cron }} state=restarted
diff --git a/deploy/adapters/ansible/roles/monitor/vars/Debian.yml b/deploy/adapters/ansible/roles/monitor/vars/Debian.yml
new file mode 100644
index 00000000..7de590c9
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/vars/Debian.yml
@@ -0,0 +1,4 @@
+---
+cron: cron
+cron_path: "/var/spool/cron/crontabs"
+
diff --git a/deploy/adapters/ansible/roles/monitor/vars/RedHat.yml b/deploy/adapters/ansible/roles/monitor/vars/RedHat.yml
new file mode 100644
index 00000000..f4ff7657
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/vars/RedHat.yml
@@ -0,0 +1,3 @@
+---
+cron: crond
+cron_path: "/var/spool/cron"
diff --git a/deploy/adapters/ansible/roles/neutron-network/vars/RedHat.yml b/deploy/adapters/ansible/roles/neutron-network/vars/RedHat.yml
index 4be67bd1..c6c9bd85 100644
--- a/deploy/adapters/ansible/roles/neutron-network/vars/RedHat.yml
+++ b/deploy/adapters/ansible/roles/neutron-network/vars/RedHat.yml
@@ -11,4 +11,4 @@ openvswitch_agent: neutron-openvswitch-agent
xorp_packages:
- openssl098e
- - xorp
+# - xorp