-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Exported Workflow Job Templates refer to inventories by id instead of natural key #7798
Labels
Comments
zedr
pushed a commit
to zedr/awx
that referenced
this issue
Aug 3, 2020
…nsible#7798 This changeset introduces two changes: 1. Update the API representation of Workflow Job Templates to use the natural key of the Inventory type instead of its id; 2. Override the related property of the CLI's WorkflowJobTemplate page type to patch the related references during the export process, allowing the resource to be serialised using the natural key of the Inventory type instead of the id. Change n.2 is a workaround that is used when exporting resources from AWX/Tower instances that don't have change n.1. It can be removed in the future.
zedr
pushed a commit
to zedr/awx
that referenced
this issue
Aug 4, 2020
…nsible#7798 This changeset introduces two changes: 1. Update the API representation of Workflow Job Templates to use the natural key of the Inventory type instead of its id; 2. Override the related property of the CLI's WorkflowJobTemplate page type to patch the related references during the export process, allowing the resource to be serialised using the natural key of the Inventory type instead of the id. Change n.2 is a workaround that is used when exporting resources from AWX/Tower instances that don't have change n.1. It can be removed in the future.
zedr
pushed a commit
to zedr/awx
that referenced
this issue
Aug 6, 2020
…nsible#7798 This changeset introduces two changes: 1. Update the API representation of Workflow Job Templates to use the natural key of the Inventory type instead of its id; 2. Override the related property of the CLI's WorkflowJobTemplate page type to patch the related references during the export process, allowing the resource to be serialised using the natural key of the Inventory type instead of the id. Change n.2 is a workaround that is used when exporting resources from AWX/Tower instances that don't have change n.1. It can be removed in the future.
Merged
I tested this manually pre-merge so now that the PR is in this should be fixed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ISSUE TYPE
SUMMARY
The API endpoint for a workflow_job_template does not provide a representation that includes the natural key of the related Inventory, if set. Instead, it just uses the numerical
id
, which is problematic when attempting to export and import the workflow between different instances of AWX/Tower, since the API will attempt to use the given numericalid
to associate an inventory to the import workflow, which will most likely be different on the target instance of AWX/Tower. This behaviour is dangerous because if the target instance of AWX/Tower has a different inventory with the same numericalid
, no warnings will be raised, causing the workflow to be associated with the wrong template.ENVIRONMENT
STEPS TO REPRODUCE
workflow_job_template
that is associated with an inventoryworkflow_job_templates.[].inventory
attribut in the exported YAML.EXPECTED RESULTS
It is reasonable to expect that the following YAML document would be generated for an example workflow_job_template object.
The document above, when imported, will generate the association with the inventory correctly on Tower 3.7.1. This is the expected behaviour, relying on the natural key of the object instead of the
id
.ACTUAL RESULTS
YAML such as the following is generated:
Notice that the
inventory
key has the value corresponding to the unique id on the source AWX/Tower server. This is not guaranteed to be the same on the target server when the object will be imported.The text was updated successfully, but these errors were encountered: