Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unfeature] no more default Ansible version #8

Merged
merged 4 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ where

## List of projects that use `foosible`

* [barsible](https://gitlab.epfl.ch/vpsi/barcode-catalyse.ops/-/blob/master/barsible)
* [botsible](https://github.com/SaphireVert/gitlabot/blob/master/ansible/botsible)
* [busible](https://github.com/epfl-si/businesscard.ops/blob/main/ansible/busible)
* [cataiamsible](https://github.com/epfl-si/catalyse-iam.ops/blob/main/cataiamsible)
Expand All @@ -48,7 +47,7 @@ where
* [juicyble](https://github.com/epfl-dojo/juice-shop-ansible/blob/master/juicyble)
* [k3sible](https://github.com/epfl-dojo/k3s-ansible/blob/master/k3sible)
* [lhdsible](https://gitlab.epfl.ch/lhd/ops/-/blob/master/lhdsible)
* [nocsible](https://github.com/epfl-si/external-noc/blob/master/ansible/nocsible)
* [nocsible](https://github.com/epfl-si/external-noc/blob/master/nocsible)
* [paysible](https://github.com/epfl-si/payonline.ops/blob/master/paysible)
* [possible](https://gitlab.epfl.ch/si-idevfsd/people-dev/-/blob/master/ops/possible)
* [presensible](https://github.com/epfl-fsd/presence_bot/blob/main/ansible/presensible)
Expand Down
37 changes: 33 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#
# $SUITCASE_DIR (mandatory) Where to install the goods to
#
# $SUITCASE_ANSIBLE_VERSION The precise version of Ansible to use.
# (mandatory)
#
# $SUITCASE_PYTHON_VERSIONS A list of acceptable Python versions
# to use. (A reasonable default value is
# provided, which will try and make use of
Expand All @@ -20,9 +23,6 @@
# Ignored if $SUITCASE_NO_EYAML is set.
# A reasonable default value is provided.
#
# $SUITCASE_ANSIBLE_VERSION The precise version of Ansible to use.
# (A reasonable default value is provided)
#
# $SUITCASE_PIP_EXTRA Additional modules to install with `pip install`
# (separated with spaces)
#
Expand Down Expand Up @@ -96,7 +96,6 @@ if [ -z "$SUITCASE_RUBY_VERSIONS" ]; then
fi
fi

: ${SUITCASE_ANSIBLE_VERSION:=3.4.0}
: ${SUITCASE_EYAML_VERSION:=3.2.0}
: ${SUITCASE_WITH_EYAML:=0}
: ${SUITCASE_WITH_KEYBASE:=1}
Expand All @@ -110,6 +109,7 @@ satisfied=
unsatisfied=

main () {
ensure_suitcase_ansible_version_set
ensure_git

[ -n "$SUITCASE_DIR" ] || fatal "SUITCASE_DIR is not set; don't know where to install"
Expand Down Expand Up @@ -167,6 +167,35 @@ fatal () {
exit 1
}

ensure_suitcase_ansible_version_set () {
# https://github.com/epfl-si/ansible.suitcase/issues/7
if [ -z "$SUITCASE_ANSIBLE_VERSION" ]; then
case "/$0" in
*/botsible)
# https://github.com/SaphireVert/gitlabot/issues/10
SUITCASE_ANSIBLE_VERSION=3.4.0 ;;
*/ictsible)
# https://github.com/ponsfrilus/ict-bot/issues/55
SUITCASE_ANSIBLE_VERSION=3.4.0 ;;
*/presensible)
# https://github.com/epfl-fsd/presence_bot/issues/30
SUITCASE_ANSIBLE_VERSION=3.4.0 ;;
*/tulsible)
# https://github.com/epfl-si/ops.tuleap/issues/1
SUITCASE_ANSIBLE_VERSION=3.4.0 ;;
*)
fatal <<'PLEASE_SET_SUITCASE_ANSIBLE_VERSION'
Please set SUITCASE_ANSIBLE_VERSION upon invoking the suitcase, e.g.

curl https://raw.githubusercontent.com/epfl-si/ansible.suitcase/master/install.sh | \
SUITCASE_ANSIBLE_VERSION=3.4.0 sh -x

PLEASE_SET_SUITCASE_ANSIBLE_VERSION
;;
esac
fi
}

satisfied () {
satisfied="$satisfied $1"
if [ -n "$2" ]; then
Expand Down