aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-09-12 13:55:40 +0800
committerbaigk <baiguoku@huawei.com>2015-09-12 16:28:25 +0800
commit6fec88cd73e388a14dcfdad812781667e5f9a668 (patch)
treefbe8e182526c29a83e1f9f5d97d0ac265191433e
parent6ec9d66787b01e710de5514f377830a94e32a4d2 (diff)
bug fix:support centos 7.1 deployment
JIRA: COMPASS-46 Change-Id: I4003c843b34509d44b45d0235fdf66d9114ff8d5 Signed-off-by: baigk <baiguoku@huawei.com>
-rwxr-xr-xbuild/make_repo.sh2
-rw-r--r--build/templates/RedHat_juno.tmpl10
-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
-rw-r--r--deploy/conf/cluster.conf2
-rw-r--r--deploy/conf/five.conf2
11 files changed, 42 insertions, 8 deletions
diff --git a/build/make_repo.sh b/build/make_repo.sh
index 1329300f..8ef3c448 100755
--- a/build/make_repo.sh
+++ b/build/make_repo.sh
@@ -148,7 +148,7 @@ function make_all_repo()
make_repo --os-ver rhel7 --package-tag juno \
--ansible-dir $WORK_PATH/deploy/adapters/ansible \
--tmpl RedHat_juno.tmpl \
- --default-package "strace net-tools wget vim openssh-server dracut-config-rescue dracut-network" \
+ --default-package "rsyslog strace net-tools wget vim openssh-server dracut-config-rescue dracut-network" \
--special-package ""
}
diff --git a/build/templates/RedHat_juno.tmpl b/build/templates/RedHat_juno.tmpl
index 8efd23b8..ae4eb815 100644
--- a/build/templates/RedHat_juno.tmpl
+++ b/build/templates/RedHat_juno.tmpl
@@ -25,6 +25,16 @@ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
+cat <<EOF >/etc/yum.repos.d/syslog.repo
+[rsyslog_v7]
+name=rsyslog
+baseurl="http://rpms.adiscon.com/v7-stable/epel-7/x86_64"
+enabled=1
+gpgcheck=0
+gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
+protect=1
+EOF
+
yum update -y
yum install createrepo -y
yum install tar -y
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
diff --git a/deploy/conf/cluster.conf b/deploy/conf/cluster.conf
index 72602ea0..71fe0b76 100644
--- a/deploy/conf/cluster.conf
+++ b/deploy/conf/cluster.conf
@@ -1,5 +1,5 @@
export ADAPTER_OS_PATTERN='(?i)ubuntu-14\.04\.3.*'
-#export ADAPTER_OS_PATTERN='(?i)centos-7\.1.*'
+#export ADAPTER_OS_PATTERN='(?i)CentOS-7.*1503-01.*'
export ADAPTER_NAME="openstack_juno"
export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$"
export ADAPTER_FLAVOR_PATTERN="HA-ansible-multinodes"
diff --git a/deploy/conf/five.conf b/deploy/conf/five.conf
index 32181b58..9abc3e9e 100644
--- a/deploy/conf/five.conf
+++ b/deploy/conf/five.conf
@@ -1,5 +1,5 @@
export ADAPTER_OS_PATTERN='(?i)ubuntu-14\.04\.3.*'
-#export ADAPTER_OS_PATTERN='(?i)centos-7\.1.*'
+#export ADAPTER_OS_PATTERN='(?i)CentOS-7.*1503-01.*'
export ADAPTER_NAME="openstack_juno"
export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$"
export ADAPTER_FLAVOR_PATTERN="single-controller"