summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/ssm-agent
diff options
context:
space:
mode:
authorJoe DeVivo <joe@devivo.com>2021-05-04 18:13:42 -0700
committerCole Helbling <cole.e.helbling@outlook.com>2021-05-10 13:16:41 -0700
commit27b4fd19ed41d6c747b8e4fc90a835757afd6558 (patch)
treea56cb27069386f4add031133bf57588b3c453a35 /pkgs/applications/networking/cluster/ssm-agent
parent96458445e29fde15b271e17567286c49c7b031f3 (diff)
downloadnixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar.gz
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar.bz2
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar.lz
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar.xz
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.tar.zst
nixpkgs-27b4fd19ed41d6c747b8e4fc90a835757afd6558.zip
ssm-agent: copy files required for agent startup
Diffstat (limited to 'pkgs/applications/networking/cluster/ssm-agent')
-rw-r--r--pkgs/applications/networking/cluster/ssm-agent/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix
index 3aa583f3ae3..79cf13b4269 100644
--- a/pkgs/applications/networking/cluster/ssm-agent/default.nix
+++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix
@@ -63,6 +63,9 @@ buildGoPackage rec {
     substituteInPlace agent/session/shell/shell_unix.go \
         --replace '"script"' '"${util-linux}/bin/script"'
 
+    substituteInPlace agent/appconfig/constants_unix.go \
+        --replace '"/etc/amazon/ssm/"' '"${placeholder "out"}/etc/amazon/ssm/"'
+
     echo "${version}" > VERSION
   '';
 
@@ -96,6 +99,20 @@ buildGoPackage rec {
     popd
   '';
 
+  # These templates retain their `.template` extensions on installation. The
+  # amazon-ssm-agent.json.template is required as default configuration when an
+  # amazon-ssm-agent.json isn't present. Here, we retain the template to show
+  # we're using the default configuration.
+
+  # seelog.xml isn't actually required to run, but it does ship as a template
+  # with debian packages, so it's here for reference. Future work in the nixos
+  # module could use this template and substitute a different log level.
+  postInstall = ''
+    mkdir -p $out/etc/amazon/ssm
+    cp go/src/${goPackagePath}/amazon-ssm-agent.json.template $out/etc/amazon/ssm/amazon-ssm-agent.json.template
+    cp go/src/${goPackagePath}/seelog_unix.xml $out/etc/amazon/ssm/seelog.xml.template
+  '';
+
   postFixup = ''
     wrapProgram $out/bin/amazon-ssm-agent --prefix PATH : ${bashInteractive}/bin
   '';