diff --git a/launch-odoo14-container.sh b/launch-odoo14-container.sh old mode 100644 new mode 100755 index c5c3f27..0d81229 --- a/launch-odoo14-container.sh +++ b/launch-odoo14-container.sh @@ -10,7 +10,7 @@ usage () } is_in () { - [[ $2 =~ (^|[[:space:]])$1($|[[:space:]]) ]] && return 1 || return 0 + [[ $2 =~ (^|[[:space:]])$1($|[[:space:]]) ]] && return 0 || return 1 } CONTAINER="$1" @@ -24,13 +24,15 @@ fi # Container cannot exist already: ALLCONTAINERS=$(lxc ls -c n --format csv) -is_in "$CONTAINER" "${ALLCONTAINERS}" -container_exists=$? - -if [[ ${container_exists} -eq 0 ]]; then +if is_in "$CONTAINER" "${ALLCONTAINERS}"; then printf 'ERROR: %s\n' "A container with that name exists already" >&2 exit 2 fi -echo "Would have launched container" +~/.venv/ansible/bin/ansible-pull \ + --url ssh://git@gitea.agofer.net:22001/jegomez/ansible-role-odoo14-launch-container \ + --extra-vars nombre=${CONTAINER} \ + --vault-password-file ~/.vault_pass.txt \ + --limit localhost,nginx \ + --inventory hosts