Skip to content

unable to use container with extravars

It is impossible to run playbook with extra-vars in format '{a: true, b:["c","d"]}' reason for this is using of parameters="$@" which cause parameters to be taken from splititng on space.

Solution to this would be using "$@" directrly on gosu command.

Background: Lets assume command was run with parameters --extra-vars '{a: true, b:["c","d"]}'

  • "$@" - in bash is equivalent to "$1" "$2"which result in--extra-vars '{a: true, b:["c","d"]}'`
  • "$parameters" - results in --extra-vars '{a:' true, b: '["c",' '"d"]}'` since variable is splited on space.

source: https://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script#comment89327701_50705846

documentation source: https://tiswww.case.edu/php/chet/bash/bashref.html#Special-Parameters

Edited by Piotr Korthals