22 lines
391 B
Bash
Executable File
22 lines
391 B
Bash
Executable File
#!/bin/bash
|
|
|
|
ANSIBLE_CONFIG=./ansible.cfg
|
|
export ANSIBLE_CONFIG
|
|
|
|
PLAY="main"
|
|
if [ "$1" == "--play" ]; then
|
|
shift
|
|
PLAY="$1"
|
|
shift
|
|
fi
|
|
|
|
if [ -f "./ansible_local.env" ]; then
|
|
. ./ansible_local.env
|
|
fi
|
|
|
|
if [ -f "./requirements.yml" ]; then
|
|
ansible-galaxy install -r requirements.yml
|
|
fi
|
|
|
|
ansible-lint --strict --project-dir . play-${PLAY}.yml && time ansible-playbook play-${PLAY}.yml $*
|