remove loglist and logview since their entire functionality is merged into show_changed

This commit is contained in:
Seth Vidal 2013-07-04 04:06:16 +00:00
parent eb5233ffff
commit d91f35cfba
2 changed files with 0 additions and 59 deletions

View file

@ -1,34 +0,0 @@
#!/bin/bash
# lists what playbooks/processes have happened today
# takes 2 optional arguments: date string, playbook name
# examples:
# ./loglist
# ./loglist yesterday
# ./loglist "last friday"
# ./loglist yesterday mirrorlist
logpath='/var/log/ansible'
when='yesterday'
if [ -n "$1" ]; then
when=$1
fi
ts=`date -d "$when" +%Y/%m/%d`
if [ -z "$2" ]; then
for dir in $logpath/*/$ts; do
if [ -d $dir ]; then
echo $dir
fi
done
exit;
fi
if [ -d $logpath/$ts/$2 ]; then
find $logpath/$2/$ts -mindepth 1 -maxdepth 1 -type d -print
else
echo "No such playbook log: $2"
exit 1
fi

View file

@ -1,25 +0,0 @@
#!/bin/bash
# view the ansible logs
# takes all the options of grep and passes them straight through - then parses the output so it looks better and readable
# should only be used on the .log files not the .info files. info files are flat readable
# example:
# logview CHANGED /var/log/2013/07/01/mirrorlist/*/*.log
IFS='
'
for line in `grep -H $@`
do
logpath=`echo $line| cut -d: -f1`
hostname=`basename $logpath`
echo -n "$hostname "
echo $line | cut -d: -f2-| cut -f3-4
json=`echo $line | cut -d: -f2- |cut -f5-`
echo $json| python -m json.tool 2>/dev/null >&2
if [ $? != 0 ]; then
echo "Error parsing json"
else
echo $json| python -m json.tool
fi
done