Pass array in --extra-vars - Ansible

前端 未结 4 1608
遇见更好的自我
遇见更好的自我 2020-12-25 10:02

How can I pass yaml array to --extra-vars in Ansible playbook. Ansible documentation does not declares its syntax nor I can find that on any internet resource.<

4条回答
  •  别那么骄傲
    2020-12-25 10:33

    In addition to answer from jarv, here is my savior note:

    In case someone wants to pass in an array of integers, this works:

    --extra-vars '{"my_params":[40,50,10,20,30]}'
    

    Note: there should be no space in between the numbers in the array you pass! Removing space solved my problem!

提交回复
热议问题