About | FAQ | Help
Ask Your Question
0

require class:something

asked 2018-03-22 04:16:18 -0500

If I have

class::something {"blah":
 parameter => test
}

How do I then "require" class::something in another resource?

E.g.

file {"/etc/something":
 ensure => present,
 require => class::something['blah']
}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-03 12:17:29 -0500

As per metaparameter documentation require expects resource references (or a list thereof). That means you have to capitalize each part of the custom type's name:

file { '/etc/something':
  ensure  => present,
  require => Class::Something['blah'],
}

alternatively, if there more than one dependencies

file { '/etc/something':
  ensure  => present,
  require => [Class::Something['blah']],
}
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

1 follower

Stats

Asked: 2018-03-22 04:16:18 -0500

Seen: 18 times

Last updated: May 03