Merge pull request #99520 from endgame/ssm-agent-user-fix
ssm-agent: fix bad user declaration
This commit is contained in:
commit
6ee8491cb1
1 changed files with 21 additions and 2 deletions
|
@ -29,8 +29,6 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.ssm-agent = {
|
||||
users.extraUsers.ssm-user = {};
|
||||
|
||||
inherit (cfg.package.meta) description;
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -43,5 +41,26 @@ in {
|
|||
RestartSec = "15min";
|
||||
};
|
||||
};
|
||||
|
||||
# Add user that Session Manager needs, and give it sudo.
|
||||
# This is consistent with Amazon Linux 2 images.
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ "ssm-user" ];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = [ "NOPASSWD" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
# On Amazon Linux 2 images, the ssm-user user is pretty much a
|
||||
# normal user with its own group. We do the same.
|
||||
users.groups.ssm-user = {};
|
||||
users.users.ssm-user = {
|
||||
isNormalUser = true;
|
||||
group = "ssm-user";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue