Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

tower-cli workflow schema provides inconsistent results #730

Open
rgerardi opened this issue Aug 1, 2019 · 1 comment
Open

tower-cli workflow schema provides inconsistent results #730

rgerardi opened this issue Aug 1, 2019 · 1 comment

Comments

@rgerardi
Copy link

rgerardi commented Aug 1, 2019

Issue description

When using a the tower-cli workflow schema command to create/update a workflow, the results are not consistent depending on the workflow content.

Versions

tower-cli version
Tower CLI 3.3.4
API v2
Ansible Tower 3.5.1
Ansible 2.8.2

Details

For example, given the following schema:

- inventory_source: "RHVM Inventory"
  success_nodes:
    - job_template: "Json query"
      failure_nodes:
        - job_template: "Print ID"
- job_template: "Vars Test"
  success_nodes:
    - job_template: "Json query"
      failure_nodes:
        - job_template: "Print ID"

Run the command:
tower-cli workflow schema Workflow01 @schema.yaml

It creates a workflow like this:
image

Results:

- id: 62
  inventory_source: 48
  success_nodes:
  - failure_nodes:
    - id: 64
      job_template: 15
    id: 63
    job_template: 50
- id: 65
  job_template: 51
  success_nodes:
  - failure_nodes:
    - id: 67
      job_template: 15
    id: 66
    job_template: 50

Then, manually update the workflow, removing one of the "Json query" nodes and linking the previous nodes to the remaining "Json query" node like this:
image

Now, when you run the tower-cli workflow schema command providing the same schema, it does not update the workflow back to its original state. This is the result:

tower-cli workflow schema Workflow01 @schema.yaml

- id: 62
  inventory_source: 48
  success_nodes:
  - failure_nodes:
    - id: 64
      job_template: 15
    id: 63
    job_template: 50
- id: 65
  job_template: 51
  success_nodes:
  - failure_nodes:
    - id: 64
      job_template: 15
    id: 63
    job_template: 50

It is inconsistent as you can obtain 2 different workflows from the same schema.

@AlanCoding
Copy link
Member

Looks like this boils down to #654

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants