Skip to content

Commit

Permalink
Add plugin support and an output plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooli Tayer committed Aug 29, 2017
1 parent b6c98c3 commit 461f187
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deployer-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LDAP_PROVIDERS="[{'name': 'test', 'challenge': 'true', 'login': 'true', 'kind':
MASTER_IP=10.35.48.200
OPENSHIFT_ANSIBLE_REF=openshift-ansible-3.6.140-1
OPENSHIFT_ANSIBLE_REPO_URL=https://github.com/openshift/openshift-ansible
PLUGIN_URLS="https://github.com/moolitayer/ocp-ansible-jenkins/blob/master/plugins/osh_common_output.sh https://github.com/moolitayer/ocp-ansible-jenkins/blob/master/plugins/osh_common_output.sh"
ROOT_PASSWORD="pass"
WORKSPACE=$(realpath ../test_workspace)

Expand All @@ -24,4 +25,4 @@ rm -rf ${WORKSPACE}/*
mkdir ${WORKSPACE}
cp -r ../ocp-ansible-jenkins/* ${WORKSPACE}/

. ${WORKSPACE}/deployer.sh
. ${WORKSPACE}/deployer.sh
24 changes: 24 additions & 0 deletions deployer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ echo "# Using inventory: "
cat ${INVENTORY_PATH}
echo "#######################################################################"

RETRCODE=0
sshpass -p${ROOT_PASSWORD} \
ansible-playbook \
--user root \
Expand All @@ -82,3 +83,26 @@ sshpass -p${ROOT_PASSWORD} \
--private-key=${ID_FILE} \
--inventory=${INVENTORY_PATH} \
${OPENSHIFT_ANSIBLE_PATH}/playbooks/byo/config.yml

if [ $? -ne '0' ]; then
RETRCODE=1
fi

COUNTER=1
for URL in $PLUGIN_URLS
do
echo "EXECUTING SCRIPT [${URL}] ON [${MASTER_HOSTNAME}]:"
sshpass -p${ROOT_PASSWORD} \
ssh -o StrictHostKeyChecking=no root@${MASTER_HOSTNAME} \
wget --quiet -O /root/script_"$(printf %02d $COUNTER)".sh ${URL}

# -o ConnectTimeout=${TIMEOUT}
sshpass -p${ROOT_PASSWORD} \
ssh -o StrictHostKeyChecking=no root@${MASTER_HOSTNAME} bash script_$(printf %02d $COUNTER).sh
if [ $? -ne '0' ]; then
RETRCODE=1
fi
COUNTER=$((COUNTER+1))
done

exit ${RETRCODE}
7 changes: 7 additions & 0 deletions plugins/osh_common_output.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo "management-admin token:"
oc sa get-token -n management-infra management-admin
echo ""

echo "OpenShift Master ca crtificate"
cat /etc/origin/master/ca.crt
echo ""

0 comments on commit 461f187

Please sign in to comment.