0

may I ask if there is a way where jenkins string variable can be handled by Ansible when triggering the playbook? I noticed that when I passed the string variable of Jenkins to Ansible the variable becomes incomplete. let say the variable is:

VARIABLE = deploying my version

And jenkins will trigger this command on pipeline:

ansible-playbook -D my-playbook.yml -e "VARIABLE=${params.VARIABLE}"

Instead of seeing this output:

deploying my version

I'm actually getting this as the result:

deploying

The other keywords are gone, please let me know if you have any ideas on fixing this. Thanks

nandilov
  • 699
  • 8
  • 18
Lagot
  • 639
  • 1
  • 9
  • 26
  • 1
    this seems to be more related to the way jenkins is treating the space separated variable. Try using a simple shell command to echo the value! Space separated values I think might need some tweak! – error404 Apr 30 '20 at 16:27

1 Answers1

0

That is possible. It looks like just syntax:

ansible-playbook -D my-playbook.yml -e ' VARIABLE="${params.VARIABLE}" '
nandilov
  • 699
  • 8
  • 18