ansibleplaybookbundle / ansible-playbook-bundle

THIS REPO IS MIGRATING: https://github.com/automationbroker/apb
GNU General Public License v2.0
140 stars 70 forks source link

apb run defined empty parameters #286

Closed ruromero closed 2 years ago

ruromero commented 6 years ago

As an APB developer I would like apb run to behave the same as the UI. If a parameter is intentionally left empty it is defined and its value is "" (empty string) which requires the developer to be aware of this behaviour.

E.g.

my_pwd: "{{ apb_my_pwd | default('foo') }}"

This is the typical way of checking a variable is defined. The outcome will be "" if executed through apb run and generated using the UI.

Although is easy to workaround by setting the true parameter to the default filter it can get more complex in some other situations:

{% if apb_my_pwd %}
- set_fact:
    my_fact: "test"
  when: !apb_my_pwd