diff --git a/tools/init-runonce b/tools/init-runonce index 05aa1ecf46..bf01639385 100755 --- a/tools/init-runonce +++ b/tools/init-runonce @@ -62,16 +62,21 @@ openstack router create demo-router openstack router add subnet demo-router demo-subnet openstack router set --external-gateway public1 demo-router +# Get admin user and tenant IDs +ADMIN_USER_ID=$(openstack user list | awk '/ admin / {print $2}') +ADMIN_PROJECT_ID=$(openstack project list | awk '/ admin / {print $2}') +ADMIN_SEC_GROUP=$(openstack security group list --project ${ADMIN_PROJECT_ID} | awk '/ default / {print $2}') + # Sec Group Config openstack security group rule create --ingress --ethertype IPv4 \ - --protocol icmp default + --protocol icmp ${ADMIN_SEC_GROUP} openstack security group rule create --ingress --ethertype IPv4 \ - --protocol tcp --dst-port 22 default + --protocol tcp --dst-port 22 ${ADMIN_SEC_GROUP} # Open heat-cfn so it can run on a different host openstack security group rule create --ingress --ethertype IPv4 \ - --protocol tcp --dst-port 8000 default + --protocol tcp --dst-port 8000 ${ADMIN_SEC_GROUP} openstack security group rule create --ingress --ethertype IPv4 \ - --protocol tcp --dst-port 8080 default + --protocol tcp --dst-port 8080 ${ADMIN_SEC_GROUP} if [ ! -f ~/.ssh/id_rsa.pub ]; then echo Generating ssh key. @@ -84,10 +89,6 @@ fi # Increase the quota to allow 40 m1.small instances to be created -# Get admin user and tenant IDs -ADMIN_USER_ID=$(openstack user list | awk '/ admin / {print $2}') -ADMIN_PROJECT_ID=$(openstack project list | awk '/ admin / {print $2}') - # 40 instances openstack quota set --instances 40 $ADMIN_PROJECT_ID