@echo off setlocal :: Default action is status if not specified if "%1"=="" ( set ACTION=status ) else ( set ACTION=%1 shift ) :: Run the manage playbook with the specified action ansible-playbook ../manage_playbook.yml -i ../inventory/hosts -e "action=%ACTION%" %*