windmill-labs / windmill

Open-source developer platform to power your entire infra and turn scripts into webhooks, workflows and UIs. Fastest workflow engine (13x vs Airflow). Open-source alternative to Retool and Temporal.
https://windmill.dev
Other
10.91k stars 531 forks source link

feat: add static variable and resources support to ansible #4435

Closed wendrul closed 1 month ago

wendrul commented 1 month ago

You can specify static variables and resources like this:


extra_vars:
  inventroy_resource:
    type: windmill_resource
    resource: u/admin/other_inventory
  my_var:
    type: windmill_variable
    variable: u/admin/beneficent_variable

They will not appear on the frontend UI but still be passed as extra-vars to the ansible playbook

Also you can specify some options:

options:
  - vvv #verbosity
  - forks: 5
  - flush_cache

Various CLI fixes


[!IMPORTANT] Add support for static variables, resources, and execution options in Ansible playbooks via YAML configuration.

  • Behavior:
    • Support for static variables and resources in Ansible playbooks via YAML in parse_ansible_sig() and parse_ansible_reqs().
    • Options like verbosity and forks can be specified in YAML and parsed in parse_ansible_options().
  • Functions:
    • parse_ansible_arg_typ(), get_default_for_typ(), and yaml_to_json() added to handle new YAML structures in lib.rs.
    • get_cmd_options() in ansible_executor.rs to convert options to command-line arguments.
  • Structures:
    • AnsiblePlaybookOptions and AnsibleRequirements updated to include new fields for options, vars, and resources.
  • Misc:
    • Added Ansible support to inferContentTypeFromFilePath() in script_common.ts.
    • Updated ZipFSElement() in sync.ts to handle Ansible playbooks.
    • Published pkg-yaml in publish-pkgs.sh.

This description was created by Ellipsis for b41a5d04f772ef58e260e6e7ab86d0447d748bf2. It will automatically update as commits are pushed.

cloudflare-workers-and-pages[bot] commented 1 month ago

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: b41a5d0
Status: ✅  Deploy successful!
Preview URL: https://689e9204.windmill.pages.dev
Branch Preview URL: https://win-399-ansible-variables-an.windmill.pages.dev

View logs

wendrul commented 1 month ago

Closes #4370