community.sap_install icon indicating copy to clipboard operation
community.sap_install copied to clipboard

collection: Automatically identify the dependent lsr collection

Open berndfinger opened this issue 3 years ago • 3 comments

We might be able to set the lsr dependency automatically from checking the content of variable ansible_collection_name, see also https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html and https://docs.ansible.com/ansible/2.9/reference_appendices/special_variables.html.

berndfinger avatar Jan 25 '23 16:01 berndfinger

@berndfinger is this still an open issue?

kksat avatar Jan 19 '24 16:01 kksat

@kksat Yes, it's still open. @sean-freeman @rhmk I just had a look at https://github.com/sap-linuxlab/community.sap_install/issues/354. To me, it looks like the following should work:

  • In the code of the affected roles, we no longer use the variable sap_general_preconfigure_system_roles_collection but a new role internal variable __sap_general_preconfigure_system_roles_collection.
  • If the variable sap_general_preconfigure_system_roles_collection is defined, we use its value for setting the internal variable __sap_general_preconfigure_system_roles_collection.
  • If sap_general_preconfigure_system_roles_collection is not defined, which would be the default, the following rules apply:
    • If ansible_collection_name is community.sap_install, we set __sap_general_preconfigure_system_roles_collection to fedora.linux_system_roles.
    • If ansible_collection_name is redhat.sap_install, we set __sap_general_preconfigure_system_roles_collection to redhat.rhel_system_roles.

berndfinger avatar Jan 23 '24 12:01 berndfinger

@berndfinger : please ensure that ansible_collection_name is set (e.g. if called as system-role from rpm, it might be unset or set differently) - in that case, you may need to double-check with ansible_role_name

rhmk avatar Jan 23 '24 13:01 rhmk

No update for more than a year, so moving to backlog.

berndfinger avatar Feb 17 '25 14:02 berndfinger