Passing variables from UNIX to Ansible to UNIX shell

I m passing a variable stringg from Unix shell which has value 'Good Day' to ansible and from ansible to a second shell script where it print only Good instead of 'Good Day'

passing the variable stringg from unix shell script1.sh

echo $stringg
  ansible-playbook install.yml -i /web/hostfiles/myhost.txt --extra-vars "mystring=$stringg"  

then passing the variable from ansible install.yml to unix shell script2.sh like this

     shell: /web/operations/script2.sh "{{mystring}}" chdir=/web/operations/

Then printing in the second unix shell script2.sh like this

echo "Printing:::::"
  echo $*

Output:

Can you please tell me why is the second script only printing Good instead of Good Day ?

I suppose the problem is this:

"mystring=$stringg"

because it is quoted on the outside, so the shell which interprets the command ansible-playbook ... will not interfere, but what is inside the quotes is interpreted by this ansible-playbook -command. Inside is an unquoted string, though, and if this command works similar to a shell it will interpret the string:

mystring=Good day

as declaration of the variable "mystring" with a value of "Good" and (maybe silently) drop "day" as a redundant word. Try it this way:

"mystring=\"$stringg\""

which might work (i don't know this ansible-playbook command, so you will have to try).

I hope this helps.

bakunin