From ff7aa016b03bf6ee3785c32566e0937d4838afce Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 15 Jun 2020 16:11:34 -0700 Subject: [PATCH] Make disable-ansible fancier So that we don't end up in a position where we find a DISABLE-ANSIBLE file in place and wonder what it is or how it got there, ask the user for a comment to place in the file. Append to the file in case it already exists. Cat the file at the end to show the user all of the comments in case there was one previously. Include the date for even more clues. Change-Id: I9c22f94c5ea93452b2975d4aae3bf7fbd9c736d0 --- .../roles/install-ansible/files/disable-ansible | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/install-ansible/files/disable-ansible b/playbooks/roles/install-ansible/files/disable-ansible index 494c9df21f..b60610ca83 100644 --- a/playbooks/roles/install-ansible/files/disable-ansible +++ b/playbooks/roles/install-ansible/files/disable-ansible @@ -3,4 +3,18 @@ # This is a simple script but ensures we don't mis-type the # file name. -touch /home/zuul/DISABLE-ANSIBLE +DISABLE_FILE=/home/zuul/DISABLE-ANSIBLE + +if [[ "$#" -lt 1 ]]; then + echo "Usage: disable-ansible COMMENT" + echo + echo "Please supply a comment to be placed in the disable file for the benefit" + echo "of other admins. Include your name. Don't forget to #status log." + exit 1 +fi + +date -Iseconds >> $DISABLE_FILE +echo "$*" >> $DISABLE_FILE + +echo "Current value of DISABLE-ANSIBLE": +cat $DISABLE_FILE