File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,11 @@ GREEN='\033[0;32m'
3030RED=' \033[0;31m'
3131# SGR code to set text color (foreground) to no color.
3232NC=' \033[0m'
33+ # the logfile to hold the output of the playbook run
34+ LOGFILE=" log/${box} _${VIRTUALENV_NAME} .log"
3335
34- echo " [INFO] $VIRTUALENV_NAME running idempotence test..."
35- ansible-playbook -i ${INVENTORY} --limit ${box} ${PLAYBOOK} | \
36+ echo " [INFO] ${ VIRTUALENV_NAME} running idempotence test..."
37+ ansible-playbook -i ${INVENTORY} --limit ${box} ${PLAYBOOK} 2>&1 | tee ${LOGFILE} | \
3638 grep " ${box} " | grep -q " ${PASS_CRITERIA} " && \
37- echo -ne " [TEST] ${box} $VIRTUALENV_NAME idempotence : ${GREEN} PASS${NC} \n" || \
38- (echo -ne " [TEST] ${box} $VIRTUALENV_NAME idempotence : ${RED} FAILED${NC} ${PASS_CRITERIA} \n" && exit 1)
39+ echo -ne " [TEST] ${box} ${ VIRTUALENV_NAME} idempotence : ${GREEN} PASS${NC} \n" || \
40+ (echo -ne " [TEST] ${box} ${ VIRTUALENV_NAME} idempotence : ${RED} FAILED${NC} ${PASS_CRITERIA} \n" && exit 1)
You can’t perform that action at this time.
0 commit comments