aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.03k stars 323 forks source link

Add initial support for Flatcar Linux #439

Closed jkroepke closed 9 months ago

jkroepke commented 2 years ago

Issue #, if available:

Description of changes:

Add support for Flatcar Linux. https://www.flatcar.org/

Since Flatcar is an immutable OS system, I mirror the Bottlerocket logic around the updater plugin.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Thor-Bjorgvinsson commented 2 years ago

Thank you for posting this CR! couple of questions:

  1. With this current change, does the agent detect the correct OS Platform? The agents send the detected OS Platform to health and can be seen either in the debug logs or from describe-instance-information API
  2. Does Flatcar need to support agent update? Dependency for agent update is that the agent is run as a service via systemd which I believe is not in environments where agent is running as a service, (see here how bottle rocket added a precondition to determine if agent update should be supported)

Once the PR is final, please rebase with mainline and squash commits into one

jkroepke commented 2 years ago

Hi @Thor-Bjorgvinsson

With this current change, does the agent detect the correct OS Platform?

Yes, I also add a test which successfully detect the OS Platform based on the /etc/os-release files.

Dependency for agent update is that the agent is run as a service via systemd which I believe is not in environments where agent is running as a service

On Flatcar, amazon-ssm-agent runs as systemd server and the binaries are mutable. But there is no pkg manager.

Here is the unit file:

[Unit]
Description=amazon-ssm-agent
After=network-online.target

[Service]
Type=simple
WorkingDirectory=/usr/share/oem
ExecStart=/usr/share/oem/bin/amazon-ssm-agent
KillMode=process
Restart=on-failure
RestartForceExitStatus=SIGPIPE
RestartSec=15min

[Install]
WantedBy=multi-user.target
jkroepke commented 1 year ago

@Thor-Bjorgvinsson @aguman-aws Can you please take a look here again?

jkroepke commented 1 year ago

@rhaoran-aws @Thor-Bjorgvinsson @aguman-aws I would appreciate an review here.

jkroepke commented 1 year ago

@cjinaws could you take a look here?

jkroepke commented 12 months ago

@gianniLesl @cjinaws @rhaoran-aws @Thor-Bjorgvinsson @aguman-aws I would appreciate a review here.

gianniLesl commented 11 months ago

Change looks good, will test internally and pull in for release

jkroepke commented 11 months ago

@gianniLesl Do you already have some feedback?

gianniLesl commented 10 months ago

Hi, this is in the pipeline for release later this month

jkroepke commented 10 months ago

@gianniLesl Do you have any information, when the release is availible?

gianniLesl commented 9 months ago

This changed was pushed with v3.2.1542.0