Mocking of non-existent resources when "puppet agent --noop"

asked 2014-06-20 11:57:55 -0600

zoquero gravatar image

Hi!

If you specify on a manifest a user resource, you specify a file resource, that this user should be the owner of the file resource and you specify their relationship, when you run "puppet agent" it creates the user, the file and sets the file ownership if needed, ok. The problem it comes if the file exists, it has a different owner and the new owner user doesn't exist, then "puppet agent --noop" fails complaining about the missing user resource:

The manifest:

...
   user { $at_user:
     ensure => present,
     ...
   } 

  file { '/etc/afile':
    owner   => $at_user,
    ...
    require => User[$at_user]
  }

And the error output:

# puppet agent --test --noop
...
Error: Could not find user my_user
Error: /Stage[main]/MyModule::Install/File[/etc/afile]/owner: change from 1001 to my_user failed: Could not find user my_user

This looks like an acceptable situation for Puppet to begin managing a host, isn't really an error.

  • Is there any way to test my manifests ("puppet agent --noop") without getting that error? May be any kind of mocking?
  • If this should be a RFC, can anybody tell me how to report it? Is it a "Normal Request For Change"? At which system? "JIRA"? (sorry, I couldn't find info)

Thanks and best regards!

/ Angel

edit retag flag offensive close merge delete