Automating the manual step of editing ood-portal.conf to add Mellon config?

Hi, my group here at NCAR are experimenting with Open OnDemand as a solution for a Science Gateway. We’re dockerizing OOD and have had success bringing up the application and authenticating a given user with our ADFS infrastructure via SAML and Mellon. But there is a manual step we’d like to eliminate.

The manual step is post executing update_ood_portal to generate the apache configuration file ood-portal.conf. We have to manually splice into the generated ood-portal.conf file the Mellon configuration for authentication (see below in abbreviated form):. Its manual because we don’t know what this file will contain. Is there a good way to automate this step that others have used either for a docker or perhaps ansible installation of OOD? Thanks for any insight!

<VirtualHost *:443>

(existing config)

<Location “/”>
MellonEnable info
MellonSamlResponseDump On
(more mellon config)

I have used the entrypoint of the container to generate the config at the start. Take a look at my boilerplate containerized method: GitHub - mjbludwig/containerized_ood