ansibleguy76 / ansibleforms

A webapplication to create pretty advanced forms to run ansible playbooks or awx templates.
https://ansibleforms.com/
GNU General Public License v3.0
66 stars 10 forks source link

Enable ytt integration #175

Closed mdaugs closed 3 months ago

mdaugs commented 3 months ago

ytt is already part of the docker image. But it is not used in the project.

Describe the solution you'd like It would be great to optionally use ytt for extended forms parsing.

This would enable templating as:

# forms.yaml
#@ load("@ytt:data", "data")
---
categories:
  - name: Default
    icon: bars
roles:
  - name: admin
    groups:
      - local/admins
constants:
  data_values: #@ data.values
forms:
  - name: Demo Form
    type: ansible
    inventory: #@ data.values.INVENTORY_PATH
    playbook: dummy.yml
fields:
  - name: var_host_name
    type: text
    label: Hostname
    default: Object($(data_values)).default_host
    eval_default: true

Where data is provided by either a file or environment variables.

ansibleguy76 commented 3 months ago

Hi, ytt was added on request once. I know it's to build dynamic yaml files, but don't know if it just integrates or not. Let me check your PR.

ansibleguy76 commented 3 months ago

integrated into new beta. please PR to devel branch