redhat-cop / controller_configuration

A collection of roles to manage Ansible Controller and previously Ansible Tower
https://galaxy.ansible.com/infra/controller_configuration
GNU General Public License v3.0
263 stars 136 forks source link

"Approve" value as role name should be "approval" in object diff #879

Closed bogdanmuresan closed 1 month ago

bogdanmuresan commented 1 month ago

Summary

When using "approval" role as a permission for a workflow, when it is retrieved from the API the value is "Approve", which gets converted to "approve" in https://github.com/redhat-cop/controller_configuration/blob/devel/plugins/lookup/controller_object_diff.py#L234

so it no longer matches with config as code, and object diff attempts to remove it and throws error:

"msg": "value of role must be one of: admin, read, member, execute, adhoc, update, use, approval, auditor, project_admin, inventory_admin, credential_admin, workflow_admin, notification_admin, job_template_admin, execution_environment_admin, got: approve",
  "invocation": {
    "module_args": {
      "team": "MyTeam",
      "role": "approve",
      "state": "absent",

awx.awx role module expects it as "approval", not "approve" https://docs.ansible.com/ansible/latest/collections/awx/awx/role_module.html

bogdanmuresan commented 1 month ago

PR to fix: https://github.com/redhat-cop/controller_configuration/pull/880