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

Fix EC2 example and set WorkingDirectory for systemd service #81

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

crhino
Copy link
Contributor

@crhino crhino commented Jan 10, 2023

With Consul 1.14.0+, we set the new tls.defaults settings in Consul configuration. Because the client config uses relative paths when downloaded from HCP, the consul service was unable to start up. This PR also fixes invalid local references in the examples terraform.

Jan 10 14:29:44 ip-10-0-1-226 consul[84162]: ==> Error loading from ./ca.pem: open ./ca.pem: no such file or directory
Jan 10 14:29:44 ip-10-0-1-226 systemd[1]: consul.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 14:29:44 ip-10-0-1-226 systemd[1]: consul.service: Failed with result 'exit-code'.
Jan 10 14:29:44 ip-10-0-1-226 systemd[1]: consul.service: Scheduled restart job, restart counter is at 5.

By setting WorkingDirectory in the systemd service file (ref), we can use relative paths from the client config without modifying them.

Screenshots after modifying the service file:

Screen Shot 2023-01-10 at 9 26 39 AM

Screen Shot 2023-01-10 at 9 26 19 AM

crhino added 2 commits January 9, 2023 15:58
This allows the Consul client config generated by HCP to use relative
path references for files in the config.
@crhino crhino requested a review from a team January 10, 2023 14:34
Copy link
Contributor

@riddhi89 riddhi89 left a comment

Choose a reason for hiding this comment

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

Great find!

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.

3 participants