Specify `servername` without rewriting the portal configuration

I want to build RockyLinux images including Open Ondemand which I can use for different clusters. The problem I have is that that requires setting the servername differently. Currently I’m using the osc.ood-ansible role with ood_portal_generator: true (as per default). This means that ansible writes ood_portal.yml.j2 , then on the systemd unit start apache runs the portal generator to generate its config. I can’t see any way of providing servername via e.g. environment variables (which would allow me to write a systemd drop-in).

I really don’t want to modify ondemand/ood-portal.conf.erb at master · OSC/ondemand · GitHub, has anyone got any ideas please??

I’m open to not using the portal generator, I see the ansible has that as an option to template the apache conf directly, but I’m not really sure of the trade-offs there. I.e. I don’t want to do something which is going against the direction of OOD development.

thanks
Steve

This is the config for servername.

I’m not sure I follow this. Why you’d need environment variables here. Even if you’re overwriting our system unit file, you should be able to use this ansible variable.

Do not use the ansible template as it’s likely out of date. That entire functionality is being deprecated so that we don’t have to maintain 2 different templates. Using the ood_portal_generator is the best way to go.

Thanks. The reason for this is ansible is running inside a packer build VM, hoping to produce “generic” images which I can use for several clusters. So servername cannot be determined at the time the role runs. I think I’ve solved it actually - it turns out apache config uses environment vars so I think I can set servername to eg. ${OPENONDEMAND_SERVERNAME} and create a systemd dropin which reads the actual value from userdata on instance creation.