using JSON files vs YAML for host vars

33 views
Skip to first unread message

Eric Marquez

unread,
Jun 22, 2016, 8:25:30 AM6/22/16
to ansible...@googlegroups.com

Is it possible to use a JSON file instead of writing the file as YAML?  Will Ansible use the two interchangeable or do you need to provide an additional setting when it’s called from Ansible-play?

 

In my Host Vars file could I have something like this?

{

  "ETHERNET_TRUNK": {

    "PORT": [

      "1/1"

    ]

  }

}

 

Vs. making the file support YAML instead?

---

ETHERNET_TRUNK:

    PORT:

      - 1/1

 

-eric

 

 

Brian Coca

unread,
Jun 22, 2016, 8:38:10 AM6/22/16
to ansible...@googlegroups.com
JSON is a subset of YAML, so the YAML parser will be able to understand it.


----------
Brian Coca

Eric Marquez

unread,
Jun 22, 2016, 9:42:51 AM6/22/16
to ansible...@googlegroups.com

Great, Thanks!

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7eruK%2BUuMYPGv-cWkMFhaeSmZAXdfyXyJCwukkc9N6avQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages