Puppet – Update resource which is already declared

If you want to update the declared resource, you need to make use of the resource reference which is denoted by the Capital letter of the type reference. The following example is found in the Puppet 3 Reference Menu.

file {'/etc/passwd':
  ensure => file,

File['/etc/passwd'] {
  owner => 'root',
  group => 'root',
  mode  => 0640,


Done =)

Reference: Puppet 3 Reference Menu – Amending Attributes With a Reference


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.