fixed some issue
This commit is contained in:
parent
8dc583b44e
commit
8e171bb79d
1 changed files with 5 additions and 6 deletions
|
@ -39,7 +39,7 @@ if $regrab;then
|
|||
|
||||
# update build_ansible file and update branch/timestamp info in current
|
||||
cp /tmp/build_ansible.sh /ansible/build_ansible.sh
|
||||
echo ${branch}:$c_time > /ansible/current
|
||||
echo ${branch}:`date +%s` > /ansible/current
|
||||
|
||||
# verify the parent script is not build_ansible.sh (to prevent the possibility of recurring until the system crashes in the case of an issue)
|
||||
me=$(basename "$0")
|
||||
|
@ -55,7 +55,7 @@ curl -k "https://git.actcur.com/actcur-ansible/playbook-builder/raw/branch/$bran
|
|||
|
||||
# verify file was downloaded successfully
|
||||
count=`grep -P "end of file" /tmp/$fqdn | wc -l`
|
||||
if [ "$count" != "2" ];then
|
||||
if [ "$count" != "1" ];then
|
||||
echo "failed to grab current playbook build file for $fqdn, exiting"
|
||||
exit
|
||||
fi
|
||||
|
@ -73,11 +73,10 @@ echo "- hosts: $fqdn
|
|||
|
||||
roles:" > /ansible/new/$fqdn.yml
|
||||
|
||||
lines=`cat /tmp/$fqdn`
|
||||
for line in $lines
|
||||
while read line
|
||||
do
|
||||
elements=()
|
||||
for element in $(echo $line | tr ";" "\n"); do elements+=("$e")
|
||||
for element in $(echo $line | tr ";" "\n"); do elements+=("$e");done
|
||||
case ${elements[0]} in
|
||||
"role")
|
||||
# format role:role name:branch/tag to use
|
||||
|
@ -111,7 +110,7 @@ do
|
|||
echo "entry: $line"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done </tmp/$fqdn
|
||||
rm -r /ansible/prev/*
|
||||
mv /ansible/$fqdn.yml /ansible/prev/
|
||||
mv /ansible/roles/ /ansible/prev
|
||||
|
|
Loading…
Add table
Reference in a new issue