From 64e710ad708de95e000a011acaf68228da9477e7 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 23 Apr 2022 11:23:36 -0500 Subject: [PATCH] Add a little contrib script to set up ara --- README.md | 2 ++ contrib/ara.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 contrib/ara.sh diff --git a/README.md b/README.md index b68616f..9237fa8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ Useful for management across all of 9iron, thefuck, and desu. For quick bootstrapping of tools and libraries used in this repo, see [rehashedsalt/ansible-env](https://gitlab.com/rehashedsalt/docker-ansible-env). I use that exact image for CI/CD. +I use ara to record Ansible plays. If your environment has it installed, source the script in `contrib/ara.sh` to configure your environment properly. + ## Deployment ### Linux Machines diff --git a/contrib/ara.sh b/contrib/ara.sh new file mode 100755 index 0000000..61f6b81 --- /dev/null +++ b/contrib/ara.sh @@ -0,0 +1,23 @@ +#! /bin/bash +# +# ara.sh +# Copyright (C) 2022 Vintage Salt +# +# Distributed under terms of the MIT license. +# + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + echo "Source this script, don't execute it" + echo " source \"${0}\"" + exit 1 +fi +ara="$(python3 -m ara.setup.callback_plugins)" +if [ -n "$ara" ]; then + export ANSIBLE_CALLBACK_PLUGINS="$ara" + export ARA_API_CLIENT="http" + export ARA_API_SERVER="https://ara.desu.ltd" + echo "Ansible configured to report to ara at $ARA_API_SERVER" +else + echo "Unable to find ara; is it installed?" +fi +unset ara