Ask Your Question
1

Invalid relationship: * { require => * }, because * doesn't seem to be in the catalog Warning: Not using cache on failed catalog.

asked 2013-05-13 07:27:06 -0500

PorkCharSui gravatar image

updated 2013-05-14 03:20:04 -0500

Can anyone please explain what I'm doing wrong?

I can't require things from the same module?!

In the accounts.pp shown at the bottom, I am trying to require a few things from the init.pp(also beneath), but when I run the module I get:

Invalid relationship: File[/admin/huey] { require => File[/admin] }, because File[/admin] doesn't seem to be in the catalog

Same thing happens for the require => Group['admins'], File['/etc/ssh/sshd_config'] in acounts.pp.

/etc/puppet/hiera/admins.yaml:

---
admins:
  huey:
    uid: 7777
    gid: 7777
    fullname: Huey Duck
    email: huey@example.nl ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-05-13 09:38:21 -0500

jonn gravatar image

It looks like you might be closing the admins class after the call to create_resources() (i.e., before the other resources are defined):

class admins (
  $admins_hash,
) {
  if ! is_hash($admins_hash) {
    fail('$admins_hash must be a hash')
  }
  create_resources(accounts, $admins_hash)
} <-- should this closing brace be here??
edit flag offensive delete link more
1

answered 2013-05-13 12:06:42 -0500

lavaman gravatar image

The define isn't being ignored, your declarations are. This is because of the module autoloading.

Take all the declarations of your define and put them in a different class that you include on nodes. Then refer to all of them as admin::pam_files{'foo'}.

What's happening is that the contents of that file are never being loaded into the catalog because you don't have a reference to that define outside that file. This is why you should only ever have one define or class per file and always declare the defines in another class that gets included ... (more)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-05-13 07:27:06 -0500

Seen: 5,598 times

Last updated: May 14 '13