Use ip6tables if nodepool is using IPv6

Change-Id: Ifebc8061dbbc99eed47938c7401b5220fd62d19a
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-08-17 13:41:47 -04:00
parent dcb55af0b2
commit 79120078ea
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
1 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,12 @@
export PATH=$PATH:/usr/local/sbin:/usr/sbin
for ip in $(cat /etc/nodepool/primary_node /etc/nodepool/sub_nodes /etc/nodepool/primary_node_private /etc/nodepool/sub_nodes_private | sort -u); do
sudo iptables -I openstack-INPUT 1 -s $ip -j ACCEPT
# Check for ipv6 address.
if echo $ip | grep -q :; then
sudo ip6tables -I openstack-INPUT 1 -s $ip -j ACCEPT
else
sudo iptables -I openstack-INPUT 1 -s $ip -j ACCEPT
fi
done
echo "" >> /home/jenkins/.ssh/authorized_keys