29 lines
565 B
Bash
29 lines
565 B
Bash
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
MAGENTA='\033[0;35m'
|
|
BLUE='\033[0;34m'
|
|
CYAN='\033[0;36m'
|
|
NC='\033[0m'
|
|
|
|
function common::log {
|
|
local MSG=$1
|
|
1>&2 printf "%b\n" "${BLUE}[INFO] ${MSG}${NC}"
|
|
}
|
|
|
|
function common::log_warn {
|
|
local MSG=$1
|
|
1>&2 printf "%b\n" "${MAGENTA}[WARN] ${MSG}${NC}"
|
|
}
|
|
|
|
function common::log_fail {
|
|
local MSG=$1
|
|
local RC=${2:-1}
|
|
1>&2 printf "%b\n" "${RED}[FAIL]: ${NC}${MSG}"
|
|
exit $RC
|
|
}
|
|
|
|
|
|
#ANSIBLE_INVENTORY="${PWD}/inventory/hosts.yml"
|
|
#[[ -e "${ANSIBLE_INVENTORY}" ]] || (common::log_fail "${ANSIBLE_INVENTORY} missing!"; exit 1)
|