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

Update variable template placeholder values #86

Merged
merged 4 commits into from Jan 25, 2021
Merged

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Jan 20, 2021

Our ansible scripts all have variable templates for local installs, and part of running the scripts is populating the templates with real values. This PR replaces the placeholders in those tempaltes so that it becomes possible to use envsubst.

This change should have no impact on any deployed site (since we are just modifying placeholders in templates), but also this shouldn't even change deployment practices since these placeholders can be just as easily populated manually as the other format.

@@ -189,7 +189,7 @@ In order to get the base system up and running, you need to use the install
from ansible instructions above for the following:

* base/mwlib
* base/torque
* base/torquedata
Copy link
Contributor Author

@slifty slifty Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the PR and snuck in (I can separate it out if you would prefer) -- just a broken reference I noticed when following instructions!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no problem. I agree in general with the principle of keeping unrelated changes separate, but let's not slow this change down by overly-eagerly applying that principle here.


# The port the flask server listens on
torquedata_port: 5000
torquedata_port: ${TORQUEDATA_PORT}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want an

# e.g. 5000

here, the way you did with "# e.g. /var/www/html" for HTML_DIRECTORY above?

The base ansible scripts have variable templates for local setup.  The
templates allow the user to specify various settings.

This commit changes the way the placeholder values are represented in
these templates, specifically to allow scripts to leverage envsubst in
certain circumstances (e.g. when using vagrant to set up a virtual
machine for local development)

Issue #85
This continues the change where we replace template placeholder values
in ansible variable templates with a placeholder format that can work
with `envsubst` to insert environment variables.

Since this is just a modification to the template placeholders this should
have no impact on installation steps (as those values would be replaced
by hand anyway).  All this does is make it possible for a script to
populate a template more easily.

Issue #85
Now that our template files support envsubst, lets let the good people
know!
@slifty
Copy link
Contributor Author

slifty commented Jan 25, 2021

I got @frankduncan's greenlight offline so I'm gonna merge this in!

@slifty slifty merged commit 744f757 into main Jan 25, 2021
@slifty slifty deleted the 85-template-envsubst branch January 25, 2021 16:35
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

Successfully merging this pull request may close these issues.

None yet

2 participants