Hi Rob, this is possible, you just need to format the extra variables as
JSON, as documented here:
http://docs.ansible.com/playbooks_variables.html#passing-variables-on-the-command-line

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

On Thu, Mar 26, 2015 at 8:37 PM, Rob White <[email protected]> wrote:

> Is it possible to pass a list as an extra-vars variable on the command
> line?
>
> I have tried various syntax but it doesn't work.
>
> E.g.
>
> ansible-playbook my_playbook.yml -i local --extra-vars
> roles_to_deploy=role1,role2
> ansible-playbook my_playbook.yml -i local --extra-vars
> roles_to_deploy=[role1,role2]
> ansible-playbook my_playbook.yml -i local --extra-vars
> roles_to_deploy=['role1','role2']
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a1c3c3ee-f51e-42c1-99bf-677ef6eaa8e5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a1c3c3ee-f51e-42c1-99bf-677ef6eaa8e5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFjwA%2B%3DdNKVW_ZdNy%2BQkn66FAg%2Bz_h9vgS3JPv2C3KxnkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to