diff --git a/changelogs/fragments/fix_workflow_survey_defaults.yml b/changelogs/fragments/fix_workflow_survey_defaults.yml new file mode 100644 index 000000000..448692971 --- /dev/null +++ b/changelogs/fragments/fix_workflow_survey_defaults.yml @@ -0,0 +1,5 @@ +--- +minor_changes: + - updated tower workflows related role `workflow_job_templates` + to include `survey_enabled` defaulting to `false` which + is a module default and `omit` the `survey_spec` if not passed. diff --git a/playbooks/tower_configs/tower_workflows.yml b/playbooks/tower_configs/tower_workflows.yml index f9bd5fbbf..71de253fb 100644 --- a/playbooks/tower_configs/tower_workflows.yml +++ b/playbooks/tower_configs/tower_workflows.yml @@ -37,3 +37,38 @@ tower_workflows: notification_templates_error: [] notification_templates_approvals: [] survey_spec: {} + - name: Simple workflow schema2 + description: a basic workflow + extra_vars: {} + allow_simultaneous: false + ask_variables_on_launch: false + inventory: + limit: + labels: + - Prod + scm_branch: + ask_inventory_on_launch: false + ask_scm_branch_on_launch: false + ask_limit_on_launch: false + organization: Default + schedules: [] + workflow_nodes: + - all_parents_must_converge: false + identifier: node101 + unified_job_template: RHVM-01 + credentials: [] + success_nodes: + - node201 + failure_nodes: [] + always_nodes: [] + - all_parents_must_converge: false + identifier: node201 + unified_job_template: test-template-1 + credentials: [] + success_nodes: [] + failure_nodes: [] + always_nodes: [] + notification_templates_started: [] + notification_templates_success: [] + notification_templates_error: [] + notification_templates_approvals: [] diff --git a/roles/workflow_job_templates/tasks/main.yml b/roles/workflow_job_templates/tasks/main.yml index 7ab845360..5d3d5e2ee 100644 --- a/roles/workflow_job_templates/tasks/main.yml +++ b/roles/workflow_job_templates/tasks/main.yml @@ -19,8 +19,8 @@ ask_limit_on_launch: "{{ workflow_loop_var.ask_limit_on_launch | default(omit) }}" webhook_service: "{{ workflow_loop_var.webhook_service | default(omit) }}" webhook_credential: "{{ workflow_loop_var.webhook_credential.name | default(workflow_loop_var.webhook_credential | default(omit)) }}" - survey_enabled: "{{ workflow_loop_var.survey_enabled }}" - survey: "{{ workflow_loop_var.related.survey_spec | default( workflow_loop_var.survey_spec) }}" + survey_enabled: "{{ workflow_loop_var.survey_enabled | default('false') }}" + survey: "{{ workflow_loop_var.related.survey_spec | default( workflow_loop_var.survey_spec | default(omit)) }}" state: "{{ workflow_loop_var.state | default(tower_state | default('present')) }}" notification_templates_started: "{{ workflow_loop_var.notification_templates_started | default(workflow_loop_var.related.notification_templates_started | default([]) | map(attribute='name') | list ) }}" notification_templates_success: "{{ workflow_loop_var.notification_templates_success | default(workflow_loop_var.related.notification_templates_success | default([]) | map(attribute='name') | list ) }}"