Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job_type for workflows #14217

Open
7 of 9 tasks
Mithur-Niranjan opened this issue Jul 10, 2023 · 1 comment
Open
7 of 9 tasks

Job_type for workflows #14217

Mithur-Niranjan opened this issue Jul 10, 2023 · 1 comment

Comments

@Mithur-Niranjan
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

New Feature

Feature Summary

The job templates have check_mode. However we can't enable a check_mode for workflows.

If we can have a UI feature for job_type and add check mode there it should automatically run all the job templates inside that workflow in check_mode job_type

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

None. As this is a request for new feature

Current results

New feature. The workaround is to create a new workflow with dry run.

Sugested feature result

Will enable a workflow to be run as a check_mode.

Additional information

No response

@sean-m-sullivan
Copy link
Contributor

Job templates have a check mode, however there is no way to force all nodes of a workflow to run in check mode.
However if a job template has the ask_job_type_on_launch flag on, a workflow node then prompts for job type in the creation.
To do this in the collection you have to include it in the workflow node creation. I've created a sample playbook to illustrate

---
- name: sample playbook
  hosts: localhost
  connection: local
  gather_facts: false
  environment:
    CONTROLLER_HOST: https://controller.nas
    CONTROLLER_USERNAME: admin
    CONTROLLER_PASSWORD: secret123
    CONTROLLER_VERIFY_SSL: false

  tasks:
    - name: Create project
      awx.awx.project:
        name: Demo Project
        scm_type: git
        scm_url: https://github.com/ansible/tower-example.git
        scm_branch: master
        scm_clean: true
        description: Test Project 1
        organization: Default
        wait: true
        update_project: true

    - name: Create job template
      awx.awx.job_template:
        name: Hello
        project: Test Project
        job_type: run
        playbook: helloworld.yml
        ask_job_type_on_launch: true
        ask_inventory_on_launch: true

    - name: Create a workflow job template with workflow nodes in template
      awx.awx.workflow_job_template:
        name: check-workflow
        workflow_nodes:
          - identifier: node201
            job_type: check
            inventory:
              name: localhost
              organization:
                name: Default
            unified_job_template:
              name: Hello
              organization:
                name: Default
              type: job_template
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants