From 12f4a6fa871cb44d81e542dc4664a5998b5fdac7 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 1 Apr 2014 08:28:15 -0700 Subject: [PATCH] Add a multinode label to nodepool Change-Id: Ie7cff6e6800d33c486f38d962e454049444d0df3 --- .../files/nodepool/scripts/multinode_setup.sh | 37 +++++++++++++++++++ .../templates/nodepool/nodepool.yaml.erb | 13 +++++++ 2 files changed, 50 insertions(+) create mode 100644 modules/openstack_project/files/nodepool/scripts/multinode_setup.sh diff --git a/modules/openstack_project/files/nodepool/scripts/multinode_setup.sh b/modules/openstack_project/files/nodepool/scripts/multinode_setup.sh new file mode 100644 index 0000000000..0d629d6eb1 --- /dev/null +++ b/modules/openstack_project/files/nodepool/scripts/multinode_setup.sh @@ -0,0 +1,37 @@ +#!/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. + +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/* diff --git a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb index 29a8d88264..ae9cb43de9 100644 --- a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb +++ b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb @@ -70,6 +70,19 @@ labels: min-ready: 1 providers: - name: rax-dfw + - name: devstack-precise-2-node + image: devstack-precise + ready-script: multinode_setup.sh + subnodes: 1 + min-ready: 1 + providers: + - name: rax-dfw + - name: rax-ord + - name: rax-iad + - name: hpcloud-az1 + - name: hpcloud-az2 + - name: hpcloud-az3 + - name: hpcloud-region-b - name: tripleo-precise image: tripleo-precise min-ready: 35