robl
2007-07-12 14:54:00 UTC
Hi,
I'm trying to import a gpg key (for repository signing) for my servers
root user, with something like this :
file { "/etc/company/company-gpg-key":
owner => root,
group => root,
mode => 0644,
source => "puppet://$puppet_server/files/backports/company-gpg-key",
}
exec { "gpg --import /etc/company/company-gpg-key":
unless => "gpg --list-keys | grep 'company'"
}
However the command is being run as the puppet user and thus not being
imported into root's gpg keyring. Is there a way to do this kind of
operation with puppet (run commands as a user other than puppet) or is
there a better/different way to achieve this ? I've had a quick look
through the existing recipes and couldn't see anything obvious.
Thanks,
Rob
I'm trying to import a gpg key (for repository signing) for my servers
root user, with something like this :
file { "/etc/company/company-gpg-key":
owner => root,
group => root,
mode => 0644,
source => "puppet://$puppet_server/files/backports/company-gpg-key",
}
exec { "gpg --import /etc/company/company-gpg-key":
unless => "gpg --list-keys | grep 'company'"
}
However the command is being run as the puppet user and thus not being
imported into root's gpg keyring. Is there a way to do this kind of
operation with puppet (run commands as a user other than puppet) or is
there a better/different way to achieve this ? I've had a quick look
through the existing recipes and couldn't see anything obvious.
Thanks,
Rob