Add update-master-node script

This is initial script for updating fuel 9.x. In future
it will use latest parameter for fuel packages in puppet.
It runs fuel/examples/deploy.sh as for boostrap admin node
process (puppet tasks run), then restart all important
master node services. Logging for this script is also added.

Change-Id: Ic4ef722b861d260c3679dca9c74f6cc62052c376
Closes-Bug: 1605602
This commit is contained in:
Oleksiy Molchanov 2016-07-22 19:34:50 +03:00 committed by Ivan Berezovskiy
parent 4cca7577f2
commit d9a449f94d
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,43 @@
#!/bin/bash
set -x
[ -d '/var/log/puppet' ] || mkdir -p /var/log/puppet
LOGFILE=${LOGFILE:-/var/log/puppet/update_master_node.log}
exec > >(tee -i "${LOGFILE}")
exec 2>&1
echo 'Master node update is in progress'
yum clean all
yum update -y
bash -x /etc/puppet/modules/fuel/examples/deploy.sh
SERVICES="
astute
cobblerd
mcollective
nailgun
nginx
openstack-keystone
ostf
rabbitmq-server
oswl_flavor_collectord
oswl_image_collectord
oswl_keystone_user_collectord
oswl_tenant_collectord
oswl_vm_collectord
oswl_volume_collectord
receiverd
statsenderd
assassind"
service postgresql restart
sleep 32
for service in $SERVICES; do
echo "Restarting $service"
systemctl restart $service
done

View File

@ -70,6 +70,7 @@ install -m 0755 %{fuel_utils_source}/dockerctl %{buildroot}/usr/bin
install -m 0755 %{fuel_utils_source}/flat_yaml.py %{buildroot}/usr/bin
install -m 0644 %{fuel_utils_source}/config %{buildroot}/etc/fuel-utils/config
install -m 0644 %{fuel_utils_source}/functions.sh %{buildroot}/usr/share/fuel-utils/functions.sh
install -m 0755 %{fuel_utils_source}/updates/update-master-node.sh %{buildroot}/usr/share/fuel-utils/update-master-node.sh
#fuel-misc
install -m 0755 %{files_source}/fuel-misc/centos_ifdown-local %{buildroot}/sbin/ifup-local
install -m 0755 %{files_source}/fuel-misc/logrotate %{buildroot}/usr/bin/fuel-logrotate
@ -174,6 +175,7 @@ This package contains a set of helpers to maintain Fuel services
/usr/bin/fuel-utils
/usr/bin/flat_yaml.py
/usr/share/fuel-utils/functions.sh
/usr/share/fuel-utils/update-master-node.sh
%config(noreplace) /etc/fuel-utils/config