Skip to content

Problem with Ansible Form when reading JSON file in the form #271

Locked Answered by ansibleguy76
jtordesillasmt asked this question in Q&A
Discussion options

You must be logged in to vote

ok... here we go

In my docker compose, I map a local folder to the persistent directory of the container.
This way, playbooks, forms, database => all consistent in case the container is recreated.

In my local data folder (mounted to the container):

When I go into my container, I find the exact same files:

Of which my json file

Now let's use the file, consider this field in the form

fields:
  - name: test
    type: enum
    expression: fn.fnReadJsonFile('/app/dist/persistent/files/sample.json')

Let's filter it with jq (although, you can just use the property columns

fields:
  - name: test
    type: enum
    expression: fn.fnReadJsonFile('/app/dist/persistent/files/sample.json','[.[]|…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@jtordesillasmt
Comment options

@ansibleguy76
Comment options

Comment options

You must be logged in to vote
7 replies
@jtordesillasmt
Comment options

@ansibleguy76
Comment options

@jtordesillasmt
Comment options

@ansibleguy76
Comment options

Answer selected by jtordesillasmt
@jtordesillasmt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants