Sync mcollective config with /etc/nailgun_uid
The contents of /etc/nailgun_uid can be changed by nailgun agent. We need to
synchronize the change to mcollective config.
Closes-Bug: #1675668
Change-Id: Idabc7be6181bc89c09e4d0caa4a7cf0c22767bfe
(cherry picked from commit ea8fc2bdfe
)
This commit is contained in:
parent
d339d77439
commit
561e1f5ba2
|
@ -58,19 +58,30 @@ sed -i "/^\s*server\b/ d" /etc/ntp.conf
|
||||||
echo "server $masternode_ip burst iburst" >> /etc/ntp.conf
|
echo "server $masternode_ip burst iburst" >> /etc/ntp.conf
|
||||||
systemctl restart ntp
|
systemctl restart ntp
|
||||||
|
|
||||||
|
sync_identity() {
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
if new_identity=$(grep -s --line-regexp "[[:digit:]]\+" /etc/nailgun_uid)
|
||||||
|
then
|
||||||
|
if [ "$new_identity" != "$identity" ]
|
||||||
|
then
|
||||||
|
identity=$new_identity
|
||||||
|
sed -i '/^identity =/d' /etc/mcollective/server.cfg > /dev/null 2>&1
|
||||||
|
echo "identity = $identity" >> /etc/mcollective/server.cfg
|
||||||
|
service mcollective restart
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Update mcollective config
|
# Update mcollective config
|
||||||
#
|
#
|
||||||
sed -i "s/^plugin.rabbitmq.pool.1.host\b.*$/plugin.rabbitmq.pool.1.host = $masternode_ip/" /etc/mcollective/server.cfg
|
sed -i "s/^plugin.rabbitmq.pool.1.host\b.*$/plugin.rabbitmq.pool.1.host = $masternode_ip/" /etc/mcollective/server.cfg
|
||||||
sed -i "s/^plugin.rabbitmq.pool.1.user\b.*$/plugin.rabbitmq.pool.1.user = $mco_user/" /etc/mcollective/server.cfg
|
sed -i "s/^plugin.rabbitmq.pool.1.user\b.*$/plugin.rabbitmq.pool.1.user = $mco_user/" /etc/mcollective/server.cfg
|
||||||
sed -i "s/^plugin.rabbitmq.pool.1.password\b.*$/plugin.rabbitmq.pool.1.password= $mco_pass/" /etc/mcollective/server.cfg
|
sed -i "s/^plugin.rabbitmq.pool.1.password\b.*$/plugin.rabbitmq.pool.1.password= $mco_pass/" /etc/mcollective/server.cfg
|
||||||
rm -f /etc/nailgun-agent/nodiscover # this will be removed as soon as new nailgun agent is committed
|
sync_identity &
|
||||||
while true; do
|
|
||||||
sleep 5
|
|
||||||
grep --line-regexp "[[:digit:]]\+" /etc/nailgun_uid && break
|
|
||||||
done
|
|
||||||
echo "identity = $(head -n 1 /etc/nailgun_uid)" >> /etc/mcollective/server.cfg
|
|
||||||
service mcollective restart
|
|
||||||
|
|
||||||
# starting distributed serialization worker
|
# starting distributed serialization worker
|
||||||
/usr/bin/dask-worker --nprocs=`nproc` --nthreads 1 @MASTER_NODE_IP@:8002
|
/usr/bin/dask-worker --nprocs=`nproc` --nthreads 1 @MASTER_NODE_IP@:8002
|
||||||
|
|
Loading…
Reference in New Issue