redhat-cop / aap_utilities

Ansible Collection for automated deployment of AAP and other objects for general use
https://galaxy.ansible.com/infra/aap_utilities
GNU General Public License v3.0
74 stars 44 forks source link

Cannot inject additional values via -e @conf.yaml into installer #117

Closed jwalzer closed 1 year ago

jwalzer commented 1 year ago

Summary

The aap_setup_install role hardcodes the commandline to call the setup.sh of the installer in a way, that only key=value variables are possible. Adding complex variables via the -e @conf.yaml parameter is not supported because of the hardcoded template.

Issue Type

The aap_setup_install role hardcodes the commandline to call the setup.sh of the installer in a way, that only key=value variables are possible. Adding complex variables via the -e @conf.yaml parameter is not supported because of the hardcoded template: https://github.com/redhat-cop/aap_utilities/blob/0391f53837fa80746c9b645270b78556526313b5/roles/aap_setup_install/templates/setup_sh.j2#L5

This is in conflict with some of the RedHat guides like LDAP integration (i.e. https://access.redhat.com/solutions/6977153) where it specifically documents in the resolution:

  • Any extra LDAP parameters that need to be set must be defined in a dictionary named ldap_extra_settings, for example one can create a YAML file as such:
#ldapextras.yml   
---
ldap_extra_settings:
AUTH_LDAP_USER_ATTR_MAP: '{"first_name": "givenName", "last_name": "sn", "email": "mail"}'
...

The above file can then be passed to the AAP installer using setup.sh -e @ldapextras.yml.

Ansible, Collection, Docker/Podman details

This is independent of the ansible or ansible-galaxy version, as it is a problem with the code in the install-role clearly linked above

This Bug is independent from the ansible installation method

OS / ENVIRONMENT

This Bug is independent from the OS/Environment

Desired Behavior

I want to provide an additionals vars file to the installer via the -e @file.yaml directive in the aap_setup_install role

Actual Behavior

I cannot provide the additional @file.yaml parameter, because the syntax doesn't make this possible

STEPS TO REPRODUCE

Try to call the aap_setup_install role with an -e @file directive

sean-m-sullivan commented 1 year ago

we've added this in a PR it should be published soon, but this should solve your issue!

ericzolf commented 1 year ago

Coming after the battle, but I think that the solution could have been to add the variables to the inventory, I don't think (but I might be wrong) that they need to be injected as extra vars. This said, it can become useful for other purposes.