From 346da608fbc71029ccac7ca559af38b0f218f3fe Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 1 Oct 2014 14:30:13 -0700 Subject: WIP Infra - Add playbooks for using openshift binary * Fixed terminate so that it properly removes the attached OS disk. --- cluster.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'cluster.sh') diff --git a/cluster.sh b/cluster.sh index 50fbe66eb..3aaabd07d 100755 --- a/cluster.sh +++ b/cluster.sh @@ -1,9 +1,16 @@ #!/bin/bash -eu -MINIONS=3 +MINIONS=1 MASTERS=1 PROVIDER=gce +# FIXME: Add option +#MASTER_PLAYBOOK=os3-master +MASTER_PLAYBOOK=openshift-master +#MINION_PLAYBOOK=os3-minion +MINION_PLAYBOOK=openshift-minion + + # @formatter:off function usage { cat 1>&2 <<-EOT @@ -17,29 +24,29 @@ EOT function create_cluser { for (( i = 0; i < $MINIONS; i ++ )); do - ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=os3-minion + ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MINION_PLAYBOOK done for (( i = 0; i < $MASTERS; i ++ )); do - ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=os3-master + ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK done update_cluster - echo -e "\nCreated ${MASTERS} masters and ${MINIONS} minions using ${PROVIDER} provider\n" + echo -e "\nCreated ${MASTERS} ${MASTER_PLAYBOOK} masters and ${MINIONS} ${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n" } function update_cluster { for (( i = 0; i < $MINIONS; i ++ )); do - ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=os3-minion + ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK done for (( i = 0; i < $MASTERS; i ++ )); do - ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=os3-master + ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MASTER_PLAYBOOK done } function terminate_cluster { - #./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=os3-master - ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=os3-minion + ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=$MASTER_PLAYBOOK + ./cloud.rb "${PROVIDER}" terminate -e "${ENV}" --type=$MINION_PLAYBOOK } [ -f ./cloud.rb ] || (echo 1>&2 'Cannot find ./cloud.rb' && exit 1) -- cgit v1.2.3 From b1b2cbe00cfe766a414972352730454c1e79c2c2 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Wed, 1 Oct 2014 15:39:26 -0700 Subject: Finish origin -> openshift rename --- cluster.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cluster.sh') diff --git a/cluster.sh b/cluster.sh index 3aaabd07d..6363e1e8d 100755 --- a/cluster.sh +++ b/cluster.sh @@ -23,25 +23,27 @@ EOT # @formatter:on function create_cluser { + for (( i = 0; i < $MASTERS; i ++ )); do + ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK + done + for (( i = 0; i < $MINIONS; i ++ )); do ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MINION_PLAYBOOK done - for (( i = 0; i < $MASTERS; i ++ )); do - ./cloud.rb "${PROVIDER}" launch -e "${ENV}" --type=$MASTER_PLAYBOOK - done update_cluster - echo -e "\nCreated ${MASTERS} ${MASTER_PLAYBOOK} masters and ${MINIONS} ${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n" + + echo -e "\nCreated ${MASTERS}/${MASTER_PLAYBOOK} masters and ${MINIONS}/${MINION_PLAYBOOK} minions using ${PROVIDER} provider\n" } function update_cluster { - for (( i = 0; i < $MINIONS; i ++ )); do - ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK - done - for (( i = 0; i < $MASTERS; i ++ )); do ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MASTER_PLAYBOOK done + + for (( i = 0; i < $MINIONS; i ++ )); do + ./cloud.rb "${PROVIDER}" config -e "${ENV}" --type=$MINION_PLAYBOOK + done } function terminate_cluster { -- cgit v1.2.3