首页 > 解决方案 > Proper syntax for adding Rundeck Ansible "Extra Vars"

问题描述

Im using Rundeck 3.0.7 with Ansible 2.7 and cant figure out the correct syntax to pass variables to my Ansible playbook. If I run it from the command line it works fine.

ansible-playbook test-playbook.yml -i hosts -e "FirstName=John LastName=Doe OfficePhone=365"

However when I add those vars to the "Extra Variables" section of the Rundeck Job I add the following and it doesnt work.

-e "FirstName=John LastName=Doe OfficePhone=365"

Does anyone know the proper syntax?

标签: jsonansibleansible-2.xrundeck

解决方案


在您的工作流程中,使用以下选项定义您的剧本额外参数:

-e "test1=${option.test1} test2=${option.test2}"

这样,您就可以在 ansible-playbook 的参数中获得这些变量名称的选项值。


推荐阅读