#!/bin/bash # Script name me=`basename "$0"` # env var to disable ansible warnong message export ANSIBLE_INVENTORY_UNPARSED_WARNING=False export ANSIBLE_ACTION_WARNINGS=false export ANSIBLE_LOCALHOST_WARNING=false if [ -z "$1" ]; then echo "Usage: $me start | stop | restart" exit fi if [ "$1" != "start" ] && [ "$1" != "stop" ] && [ "$1" != "restart" ]; then echo "Usage: $me start | stop | restart" exit fi case $1 in start) ansible-playbook chat-box-ctl.yml --tags "start" ;; stop) ansible-playbook chat-box-ctl.yml --tags "stop" ;; restart) ansible-playbook chat-box-ctl.yml --tags "stop" ansible-playbook chat-box-ctl.yml --tags "start" ;; esac