Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Switch from supervisord to systemd #62

Merged
merged 3 commits into from
Apr 10, 2020
Merged

Conversation

draoncc
Copy link
Contributor

@draoncc draoncc commented Apr 7, 2020

Closes #18 by switching to Amazon Linux 2 and changing to systemd.

Heavily based on https://github.com/hashicorp/terraform-aws-consul/pull/130/files

After noticing the lack of activity on #45 I decided to create a pull request myself. All points brought up in that stale pull request should have been addressed. I have so far been unable to get the tests running, though.

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 7, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

This is terrific work, thank you! I'll kick off tests now.

the log output location, you can specify the `StandardOutput` and `StandardError` options by using the `--systemd-stdout` and `--systemd-stderr`
options. See the [`systemd.exec` man pages](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=) for available
options, but note that the `file:path` option requires [systemd version >= 236](https://stackoverflow.com/a/48052152), which is not provided
in the base Ubuntu 16.04 and Amazon Linux 2 images.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for updating the docs 👍

@brikis98
Copy link
Collaborator

brikis98 commented Apr 8, 2020

Packer build failed:

TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami: Or undo this operation with:
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami:
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami:   git switch -
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami:
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami: Turn off this advice by setting config variable advice.detachedHead to false
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami:
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami: 2020-04-08 08:34:04 [INFO] [install-consul] Starting Consul install
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:04Z command.go:158: 1586334844,,ui,error,==> amazon-linux-2-ami: 2020-04-08 08:34:04 [INFO] [install-consul] Installing dependencies
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:05Z command.go:158: 1586334845,,ui,message,    amazon-linux-2-ami: Loaded plugins: extras_suggestions%!(PACKER_COMMA) langpacks%!(PACKER_COMMA) priorities%!(PACKER_COMMA) update-motd
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:05Z command.go:158: 1586334845,,ui,message,    amazon-linux-2-ami: No packages marked for update
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:05Z command.go:158: 1586334845,,ui,message,    amazon-linux-2-ami: Loaded plugins: extras_suggestions%!(PACKER_COMMA) langpacks%!(PACKER_COMMA) priorities%!(PACKER_COMMA) update-motd
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:05Z command.go:158: 1586334845,,ui,message,    amazon-linux-2-ami: No package aws available.
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:06Z command.go:158: 1586334846,,ui,message,    amazon-linux-2-ami: Package curl-7.61.1-12.amzn2.0.1.x86_64 already installed and latest version
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:06Z command.go:158: 1586334846,,ui,message,    amazon-linux-2-ami: Package unzip-6.0-20.amzn2.x86_64 already installed and latest version
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:06Z command.go:158: 1586334846,,ui,message,    amazon-linux-2-ami: Package jq-1.5-1.amzn2.0.2.x86_64 already installed and latest version
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:06Z command.go:158: 1586334846,,ui,message,    amazon-linux-2-ami: Nothing to do
TestNomadConsulClusterSeparateAmazonLinux2Ami 2020-04-08T08:34:06Z command.go:158: 1586334846,,ui,error,==> amazon-linux-2-ami: sudo: pip: command not found

@draoncc
Copy link
Contributor Author

draoncc commented Apr 9, 2020

It seems I forgot to update consul_module_version in the packer build files. That's fixed now, though the earliest version of that module that builds for Amazon Linux 2 also installs consul with version 1.2.2, whereas this module still goes with 1.0.3.

I've updated the Consul version to 1.5.1, to match the latest version of terraform-aws-consul, and Nomad to the nearest version going by release date, which is 0.9.1.

@brikis98
Copy link
Collaborator

Great, thanks! I'll kick off tests again.

@brikis98
Copy link
Collaborator

Alright, tests passed! Merging now. Thank you for the contribution!

@brikis98 brikis98 merged commit 347cec8 into hashicorp:master Apr 10, 2020
@brikis98
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

[IMPROVEMENT] Upgrade Amazon Linux Support to Version 2
3 participants