Hi,
Puppet's basic mode of operation is to *tell* systems whether they
should have both the user and the key or should remove both:
class kolchanov($ensure = present) {
user { 'kolchanov': ensure => $ensure, ... }
file { '/etc/ssh/keys/kolchanov_keys': ensure => $ensure, ... ]
}
If you really have to depend on an external process creating that user
and have to react to this, then you need to code up a fact that queries
the system. This information will be run by the agent everytime before
contacting the master. See the facter documentation for more details:
http://docs.puppetlabs.com/guides/custom_facts.html
Good luck and have fun, David
On 2014-05-11 09:19, Kirill K wrote:
> Hi,
>
> file.pp:
> сlass keys {
> file { '/etc/ssh/keys':
> ensure => directory,
> }
> *#I don't understand how to get variable from the operating system?*
> $kolchanov_id = "id kolchanov"
>
> *#If such user available, need copy him public key to the folder. Else,
> remove an existing public key.*