Skip to content

Instantly share code, notes, and snippets.

@pbrandiezs
Created November 30, 2018 22:39
Show Gist options
  • Save pbrandiezs/3a8017d0c1aeebada4f37b5337c32838 to your computer and use it in GitHub Desktop.
Save pbrandiezs/3a8017d0c1aeebada4f37b5337c32838 to your computer and use it in GitHub Desktop.
Puppet example code using a selector to set the mode of a file.
$file_mode = $facts['os']['family'] ? {
'Debian' => '0600',
'RedHat' => '0655',
default => '0700',
}
file { '/tmp/test_mode.txt':
ensure => file,
mode => $file_mode,
owner => 'root',
group => 'root',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment