![Attila Fazekas](/assets/img/avatar_default.png)
The systemd version of iptables requires the 'iptables-services' package for having the `regular` iptables rule restore on service startup. The service also needs to be enabled explicitly. Another iptables related issue with multinode_setup.sh, tries to executes the iptables command without login shell. The non-login shell does not contains /usr/sbin in PATH, so multinode_setup.sh changed to use login shell defaults. Warning: This change enables the iptables service on all distribution. Change-Id: I3174e43b3b19e28073a4364dd0f66fc39b0fa815
40 lines
1.2 KiB
Bash
Executable File
40 lines
1.2 KiB
Bash
Executable File
#!/bin/bash -xe
|
|
|
|
# Copyright (C) 2014 OpenStack Foundation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
#
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
|
|
|
for ip in `cat /etc/nodepool/primary_node /etc/nodepool/sub_nodes`; do
|
|
sudo iptables -I openstack-INPUT 1 -s $ip -j ACCEPT
|
|
done
|
|
|
|
echo "" >> /home/jenkins/.ssh/authorized_keys
|
|
cat /etc/nodepool/id_rsa.pub >> /home/jenkins/.ssh/authorized_keys
|
|
echo "" >> /home/jenkins/.ssh/authorized_keys
|
|
|
|
ROLE=`cat /etc/nodepool/role`
|
|
if [ $ROLE == "primary" ]; then
|
|
cp /etc/nodepool/id_rsa /home/jenkins/.ssh/id_rsa
|
|
chmod 0600 /home/jenkins/.ssh/id_rsa
|
|
else
|
|
rm /etc/nodepool/id_rsa
|
|
fi
|
|
|
|
sudo chown -R root:root /etc/nodepool
|
|
sudo chmod 0755 /etc/nodepool
|
|
sudo chmod 0444 /etc/nodepool/*
|