Private
Public Access
2
0
Files
bgwaf/example/ansible/run_ansible.sh
2026-01-20 17:40:16 +03:00

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 $*