summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml18
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml4
-rw-r--r--deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml4
-rwxr-xr-xdeploy/prepare.sh186
9 files changed, 193 insertions, 39 deletions
diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
index b18ae8f7..780fc322 100644
--- a/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
+++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_config.yml
@@ -41,6 +41,24 @@
script: remove_user.sh
when: ansible_os_family == "RedHat"
+- name: restart mysql for centos noha
+ service:
+ name: mysql
+ state: restarted
+ when: >
+ inventory_hostname == haproxy_hosts.keys()[0]
+ and haproxy_hosts|length == 1
+ and ansible_os_family == "RedHat"
+
+- name: restart mysql second time for centos noha
+ service:
+ name: mysql
+ state: restarted
+ when: >
+ inventory_hostname == haproxy_hosts.keys()[0]
+ and haproxy_hosts|length == 1
+ and ansible_os_family == "RedHat"
+
- name: restart first nodes
service:
name: mysql
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml
index b13b76f9..8d5794f7 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-nosdn-nofeature-ha.yml
@@ -31,9 +31,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml
index 9eb4adae..bd10dc6d 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-ocl-nofeature-ha.yml
@@ -31,9 +31,9 @@ hosts:
- ceph-osd
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
index 16739a8b..2286bc6a 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
@@ -35,9 +35,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
index 98b24a1e..241ea650 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
@@ -33,9 +33,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
index 2c578faa..f7d2b587 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
@@ -35,9 +35,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml
index aec1ff09..09d59628 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-nofeature-ha.yml
@@ -33,9 +33,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml
index 98ae5eba..e7956d9b 100644
--- a/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml
+++ b/deploy/conf/hardware_environment/huawei-pod1/os-onos-sfc-ha.yml
@@ -35,9 +35,9 @@ hosts:
- ceph-mon
- name: host3
- mac: 'D8:49:0B:DA:67:1F'
+ mac: '78:D7:52:A0:B1:99'
interfaces:
- - eth1: 'D8:49:0B:DA:67:20'
+ - eth1: '78:D7:52:A0:B1:9A'
ipmiIp: 172.16.130.29
ipmiPass: Huawei@123
roles:
diff --git a/deploy/prepare.sh b/deploy/prepare.sh
index 22183f49..4ce78184 100755
--- a/deploy/prepare.sh
+++ b/deploy/prepare.sh
@@ -9,11 +9,11 @@
##############################################################################
function print_logo()
{
- if ! apt --installed list 2>/dev/null | grep "figlet"
- then
- sudo apt-get update -y
- sudo apt-get install -y --force-yes figlet
- fi
+# if ! apt --installed list 2>/dev/null | grep "figlet"
+# then
+# sudo apt-get update -y
+# sudo apt-get install -y --force-yes figlet
+# fi
figlet -ctf slant Compass Installer
set +x; sleep 2; set -x
@@ -72,26 +72,162 @@ function _prepare_python_env() {
mkdir -p $WORK_DIR/venv
if [[ "$DEPLOY_FIRST_TIME" == "true" ]]; then
- sudo apt-get update -y
- sudo apt-get install -y --force-yes mkisofs bc curl ipmitool openvswitch-switch
- sudo apt-get install -y --force-yes git python-dev python-pip
- sudo apt-get install -y --force-yes libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev
- sudo apt-get install -y --force-yes libffi-dev libssl-dev
- fi
-
- sudo pip install --upgrade virtualenv
- virtualenv $WORK_DIR/venv
- source $WORK_DIR/venv/bin/activate
-
- pip install --upgrade cffi
- pip install --upgrade MarkupSafe
- pip install --upgrade pip
- pip install --upgrade cheetah
- pip install --upgrade pyyaml
- pip install --upgrade requests
- pip install --upgrade netaddr
- pip install --upgrade oslo.config
- pip install --upgrade ansible
+
+ if [[ ! -z "$JHPKG_URL" ]]; then
+ _pre_env_setup
+ else
+ sudo apt-get update -y
+ sudo apt-get install -y --force-yes mkisofs bc curl ipmitool openvswitch-switch
+ sudo apt-get install -y --force-yes git python-dev python-pip figlet
+ sudo apt-get install -y --force-yes libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev
+ sudo apt-get install -y --force-yes libffi-dev libssl-dev
+
+ fi
+ else
+ if [[ ! -z "$JHPKG_URL" ]]; then
+ _pre_pip_setup
+ else
+ sudo pip install --upgrade virtualenv
+ virtualenv $WORK_DIR/venv
+ source $WORK_DIR/venv/bin/activate
+
+ pip install --upgrade cffi
+ pip install --upgrade MarkupSafe
+ pip install --upgrade pip
+ pip install --upgrade cheetah
+ pip install --upgrade pyyaml
+ pip install --upgrade requests
+ pip install --upgrade netaddr
+ pip install --upgrade oslo.config
+ pip install --upgrade ansible
+ fi
+ fi
+}
+
+function _pre_env_setup()
+{
+ rm -rf $WORK_DIR/prepare
+ mkdir -p $WORK_DIR/prepare
+ jhpkg_url=${JHPKG_URL:7}
+ echo $jhpkg_url
+ if [[ ! -f "$jhpkg_url" ]]; then
+ echo "There is no jh_env_package."
+ exit 1
+ fi
+
+ tar -zxvf $jhpkg_url -C $WORK_DIR/prepare/
+ cd $WORK_DIR/prepare/jh_env_package
+ tar -zxvf trusty-jh-ppa.tar.gz
+
+ if [[ -f /etc/apt/apt.conf ]]; then
+ mv /etc/apt/apt.conf /etc/apt/apt.conf.bak
+ fi
+
+ cat << EOF > /etc/apt/apt.conf
+APT::Get::Assume-Yes "true";
+APT::Get::force-yes "true";
+Acquire::http::Proxy::127.0.0.1:9998 DIRECT;
+EOF
+
+ if [[ -f /etc/apt/sources.list ]]; then
+ mv /etc/apt/sources.list /etc/apt/sources.list.bak
+ fi
+
+ cat << EOF > /etc/apt/sources.list
+deb [arch=amd64] http://127.0.0.1:9998/trusty-jh-ppa trusty main
+EOF
+
+ nohup python -m SimpleHTTPServer 9998 &
+
+ cd -
+ sleep 5
+ apt-get update
+ apt-get install -y mkisofs bc curl ipmitool openvswitch-switch \
+ git python-pip python-dev figlet \
+ libxslt-dev libxml2-dev libvirt-dev \
+ build-essential qemu-utils qemu-kvm libvirt-bin \
+ virtinst libmysqld-dev \
+ libssl-dev libffi-dev python-cffi
+ pid=$(ps -ef | grep SimpleHTTPServer | grep 9998 | awk '{print $2}')
+ echo $pid
+ kill -9 $pid
+
+ sudo cp ${COMPASS_DIR}/deploy/qemu_hook.sh /etc/libvirt/hooks/qemu
+
+ rm -rf /etc/apt/sources.list
+ if [[ -f /etc/apt/sources.list.bak ]]; then
+ mv /etc/apt/sources.list.bak /etc/apt/sources.list
+ fi
+
+ rm -rf /etc/apt/apt.conf
+ if [[ -f /etc/apt/apt.conf.bak ]]; then
+ mv /etc/apt/apt.conf.bak /etc/apt/apt.conf
+ fi
+}
+
+function _pre_pip_setup()
+{
+ if [[ -d ~/.pip ]]; then
+ if [[ -f ~/.pip/pip.conf ]]; then
+ mv ~/.pip/pip.conf ~/.pip/pip.conf.bak
+ fi
+ else
+ mkdir -p ~/.pip
+ fi
+
+# rm -rf ~/.pip
+# mkdir -p ~/.pip
+ rm -rf $WORK_DIR/prepare
+ mkdir -p $WORK_DIR/prepare
+ jhpkg_url=${JHPKG_URL:7}
+ echo $jhpkg_url
+ if [[ ! -f "$jhpkg_url" ]]; then
+ echo "There is no jh_env_package."
+ exit 1
+ fi
+
+ tar -zxvf $jhpkg_url -C $WORK_DIR/prepare/
+ cd $WORK_DIR/prepare/jh_env_package
+ tar -zxvf env_trusty_pip.tar.gz
+
+ cat << EOF > ~/.pip/pip.conf
+[global]
+find-links = http://127.0.0.1:9999/jh_pip
+no-index = true
+[install]
+trusted-host=127.0.0.1
+EOF
+
+ nohup python -m SimpleHTTPServer 9999 &
+
+ sleep 5
+
+ cd -
+
+ pip install --upgrade virtualenv
+
+ virtualenv $WORK_DIR/venv
+ source $WORK_DIR/venv/bin/activate
+
+ #pip install --upgrade cffi
+
+ PIP="cffi MarkupSafe pip cheetah pyyaml requests netaddr oslo.config ansible"
+
+ #PIP="paramiko jinja2 PyYAML setuptools pycrypto pyasn1 cryptography MarkupSafe idna six enum34 ipaddress pycparser virtualenv cheetah requests netaddr pbr oslo.config ansible"
+ for i in ${PIP}; do
+ pip install --upgrade $i
+ done
+
+ pid=$(ps -ef | grep SimpleHTTPServer | grep 9999 | awk '{print $2}')
+ echo $pid
+ kill -9 $pid
+
+ if [[ -f ~/.pip/pip.conf.bak ]]; then
+ mv ~/.pip/pip.conf.bak ~/.pip/pip.conf
+ else
+ rm -rf ~/.pip/pip.conf
+ fi
+# rm -rf ~/.pip/pip.conf
}
function prepare_python_env()