Closed mdaugs closed 3 months ago
Describe the bug A multistep form is always reported as success and all steps are executed even if one step fails.
To Reproduce
- name: Demo Form type: multistep description: Demo Form roles: - admin icon: bullseye steps: - name: wait for approval type: ansible playbook: await_approval.yml approval: title: Please approve demo message: | You need to approve the demo run. Double check please. roles: - public ifExtraVar: var_approval_required - name: wait for scheduled start type: ansible playbook: wait_scheduled_start.yml ifExtraVar: var_schedule_job - name: Load current Inventory type: ansible playbook: load_inventory.yml - name: Run dummy type: ansible inventory: /tmp/inventory.yml playbook: dummy.yml fields: - name: var_inventory_url type: text - name: var_approval_required type: checkbox label: Request Approval group: Preconditions - name: var_schedule_job type: checkbox label: Schedule Job width: is-2 group: Preconditions line: schedule_line - name: var_scheduled_datetime type: datetime dateType: datetime label: Scheduled Start (Date and Time) width: is-3 dependencies: - name: var_schedule_job values: - true group: Preconditions line: schedule_line
The playbooks are defined as:
# await_approval.yml - name: Checking Approval status hosts: localhost tasks: - name: print approval message debug: msg: "The play has been approved"
# wait_scheduled_start.yml - name: Waiting for the scheduled start hosts: localhost vars: var_current_datetime: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}" tasks: - name: "Calculate the seconds to pause the play." set_fact: var_wait_seconds: "{{ ((var_scheduled_datetime | to_datetime) - (var_current_datetime | to_datetime)).total_seconds() }}" - name: "Show the datetimes and seconds to play the pause." debug: msg: "{{ var_scheduled_datetime }} :: {{ var_current_datetime }} :: {{ var_wait_seconds }}" - name: Wait for starting time wait_for: timeout: "{{ var_wait_seconds | int }}" when: var_wait_seconds | int > 0
```yaml # load_inventory.yml - name: Load Inventory hosts: localhost tasks: - name: Get inventory from URL ansible.builtin.get_url: dest: /tmp/inventory.yml url: "{{ var_inventory_url }}"
# dummy.yaml - name: Dummy playbook for Demo hosts: demo-host # -- Any Host in inventory tasks: - name: Test connection ansible.builtin.ping:
Expected behavior
Screenshots
Version ansibleforms v5.0.1
Deployment Deployed ansibleforms with :
That's indeed a new bug. I will need to check when it got introduced and what I changed.
Bug is found and fixed. Will push new beta in the next hour.
Describe the bug A multistep form is always reported as success and all steps are executed even if one step fails.
To Reproduce
The playbooks are defined as:
Expected behavior
Screenshots
Version ansibleforms v5.0.1
Deployment Deployed ansibleforms with :