#!/bin/bash [[ -z $1 ]] && echo target? && exit 1 target=$1 #echo -n generate ansible_vars.json ... #[[ ! -r ansible_vars ]] && echo cannot read ansible_vars && exit 1 #../jsonencode ansible_vars > ansible_vars.json && echo done #echo -n writing ansible_vars.json from vault ... #../grab-secrets.bash > ansible_vars.json && echo done # allow usage of foreign target host-group e.g. if you want to deploy/maintain fluentbit # speficially on the vpn nodes, you could use target=netbird_agent or target=suricata # this feature is available by default when using a single inventory file prep_inventory_list=`find ../inventory/ -maxdepth 1 -type f` prep_inventory_args=`echo "$prep_inventory_list" | sed 's/^/-i /'` echo debug: $prep_inventory_args ansible-playbook tasks-fluentbit-setup.yml $prep_inventory_args -e "target=$target" -e @ansible_vars.json --check echo ready? read -r ansible-playbook tasks-fluentbit-setup.yml $prep_inventory_args -e "target=$target" -e @ansible_vars.json