-
Notifications
You must be signed in to change notification settings - Fork 145
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
A failure occurs when removing a template and schedule #673
Comments
it's an order of operations, it has no way of knowing that you just removed a schedule from a template, or the entire template, It might be a module improvement to account for these, I would expect and have seen the same of a inventory source when either an inventory or a project is removed. |
I agree @sean-m-sullivan, it's an order mistake. I think @Rickmarges should call dispatch role in reverse order (first schedule and then job_templates. To avoid these kind of problems, you should change completely the order which is defined by default in the dispatch role: https://github.com/redhat-cop/controller_configuration/blob/devel/roles/dispatch/defaults/main.yml#L2 |
@adonisgarciac I don't agree with you on that one. If you first execute the schedules before the templates, you'll run into en error during creation. Because you can't create a schedule for a template that doesn't exist. Having said that, I believe it is something that should be changed in the schedule module to not give an error if the schedule and template don't exist. |
this is similar to the org and galaxy credentials chicken and egg, but shedule should be run after everything it can schedule and it should just work. |
Yes, that's it to the creation phase but you failure is during the remove phase (which has to be executed in the exactly reverse order of creation). You'll not be able to launch the creation and deletion in the same call to dispatch, you have to do it separately. |
@adonisgarciac it actually is possible to do it at the same time. When using the |
Technically yes, but you'll face with the same problem you are facing in several object types (inventory/inventory_source, organizations/galaxy_credentials, credentials/credentials_type, etc..) Roles within this collections are treated as single kind of object. I think is not a good idea to change this behavior. So, IMHO, the complexity should be in the playbook, not in the roles of the collection. |
agreed, the roles are independent, its difficult to account for all possibilities like this. I am closing this case unless we find a better way to account for these. |
Summary
When removing a template and schedule from the configuration, a failure occurs when ran using the diff roles.
Issue Type
Ansible, Collection, Controller details
ansible-core == 2.15.1
ansible.controller == 4.4.0
controller_configuration == 2.5.0
Ansible installation method: EE
OS / ENVIRONMENT
OpenShift deployment of Ansible Automation Platform
Desired Behavior
The template and schedule are removed without any errors.
Actual Behavior
Since the template and schedule have a 1-to-1 mapping, the schedule is already removed when removing a template.
However, when removing them both from the configuration, the diff roles sets state
abesnt
for both.When trying to remove the schedule (after the removal of the template), the playbook gives an error.
STEPS TO REPRODUCE
First run (to create them):
Second run (to remove them):
The text was updated successfully, but these errors were encountered: