On Tue, Feb 18, 2020 at 04:39:27AM -0800, Jerome Meyer wrote:
> Hi Team,
>
> I'm encountered some issue with set_facts from variable with json and for
> this reason I'm tried to understand this. To reproduce this case I'm using
> the example from here : playbooks filters
> <
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#filters-for-formatting-data>
>
> tasks
> - shell: cat /some/path/to/file.json
> register: result
>
> - set_fact:
> myvar: "{{ result.stdout | from_json }}"
>
>
> I've created one example.fson file :
> # cat files/example.json
> json_example: |
> {
> "example_simple": {
> "name": "simple",
> "foo": "value",
> "item": "this"
> },
> }
This is not correct json syntax.
It looks like yaml json_example multiline with an incorrectly syntax json in
it.
--
Kai Stian Olstad