diff options
Diffstat (limited to 'bin')
l--------- | bin/ansible | 1 | ||||
l--------- | bin/ansible-community | 1 | ||||
l--------- | bin/ansible-galaxy | 1 | ||||
l--------- | bin/ansible-inventory | 1 | ||||
l--------- | bin/ansible-playbook | 1 | ||||
l--------- | bin/ansible-vault | 1 | ||||
-rwxr-xr-x | bin/python-tool | 29 | ||||
-rw-r--r-- | bin/requirements.txt | 1 |
8 files changed, 36 insertions, 0 deletions
diff --git a/bin/ansible b/bin/ansible new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/ansible-community b/bin/ansible-community new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible-community @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible-galaxy @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/ansible-inventory b/bin/ansible-inventory new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible-inventory @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/ansible-playbook b/bin/ansible-playbook new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible-playbook @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/ansible-vault b/bin/ansible-vault new file mode 120000 index 0000000..42ff5d8 --- /dev/null +++ b/bin/ansible-vault @@ -0,0 +1 @@ +python-tool
\ No newline at end of file diff --git a/bin/python-tool b/bin/python-tool new file mode 100755 index 0000000..27cab43 --- /dev/null +++ b/bin/python-tool @@ -0,0 +1,29 @@ +#!/bin/bash + +set -euo pipefail + +basedir="${0%/*}" +self="${0##*/}" +cmd="$basedir/env/bin/$self" + +if [[ ! -x $cmd ]] +then + if [[ ! -d $basedir/env ]] + then + virtualenv --python=python3 $basedir/env + fi + + if [[ ! -e $basedir/env/.cookie || $basedir/requirements.txt -nt $basedir/env/.cookie ]] + then + $basedir/env/bin/pip install -r $basedir/requirements.txt + touch $basedir/env/.cookie + fi +fi + +if [[ "$self" == "python-tool" ]] +then + echo "$0: Setup complete" + exit 0 +fi + +exec "$cmd" "${@}" diff --git a/bin/requirements.txt b/bin/requirements.txt new file mode 100644 index 0000000..a3669d5 --- /dev/null +++ b/bin/requirements.txt @@ -0,0 +1 @@ +ansible==8.4.0 |