Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition/use of servername problematic #127

Open
sjpb opened this issue Oct 21, 2021 · 3 comments
Open

Definition/use of servername problematic #127

sjpb opened this issue Oct 21, 2021 · 3 comments

Comments

@sjpb
Copy link
Contributor

sjpb commented Oct 21, 2021

(firstly, thanks for OOD and this role!)

The definition and use of servername is a bit problematic when NOT accessing the OOD node by IP, i.e so we don't want name-based virtual hosting:

  • Default here is to define something (localhost)
  • The templating here includes the ServerName directive (?) if servername is defined.

Firstly, I think the role var should be e.g. ood_servername to make it more obvious what it's setting, could refer to loads of things and at least that'd let you look up the OOD docs.

Secondly, I think the templating of SeverName should be conditional on it being both defined AND truth-y. The problem is that with more complicated inventory setups it can get impossible to un-define the variable again. I can give a specific example but it'll seem odd but I think in general having to have variables undefined to get specific behaviour is problematic.

@sjpb
Copy link
Contributor Author

sjpb commented Oct 21, 2021

Having remembered that ansible's "truthy" is not very intuitive I had a play - what I mean is that I think the templating would be better as:

{% if ood_servername is defined and ood_servername %}
  ServerName {{ servername }}
{% endif %}

That way you can explicitly set ood_servername: '' to turn off writing ServerName.

@johrstrom
Copy link
Collaborator

Thanks for the reminder. Templates are being deprecated in #128. At some point we're going to stop supporting them and folks should just use the ood_portal_generator as it's more stable now with debian and is more maintainable from this repos standpoint.

To the variable, are you saying the default should actually be null/empty and not localhost?

@sjpb
Copy link
Contributor Author

sjpb commented Oct 21, 2021

Re. templates - I think I am using the portal generator, at least I think I see it running in the ansible - isn't my first link the template the portal generator uses?? If not, how would I set servername once #128 is done?

Re. the variable. I have no familiarity with name-based virtual hosting so I don't know if the default of localhost makes sense generally. What I know is that accessing my ondemand server through a (proxied, private) IP address rather than a host+domain URL I had to set it to null/empty to remote that ServerName directive and get it to work - otherwise the openondemand virtual server never "saw" the request (probably wrong terminology!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants