Skip to content

Comment on Why Puppet Should Manage Your Infrastructureparent

Comments

Or you could override the default file resource attributes in sites.pp:

  File {
    owner => root,
    group => root,
    mode => 644,
  }
Then you could override that again in individual file resources. If you need several file resources with the same attributes you can override them within the scope of a class:
  class postgresql {
    File {
      owner => "postgres",
      group => "postgres",
      mode => 640,
    }
  
    $pgsql_root = "/etc/postgresql/8.4/main"
    file { "$pgsql_root/postgresql.conf":
      content => template("postgresql/postgresql.conf.erb"),
      require => Package["postgresql"],
    }
  
    file { "$pgsql_root/pg_hba.conf":
      content => template("postgresql/pg_hba.conf.erb"),
      require => Package["postgresql"],
    }
  }
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.