Skip to content

Instantly share code, notes, and snippets.

@devcfgc
Last active December 20, 2016 09:58
Show Gist options
  • Save devcfgc/61205be17843ce792d1b to your computer and use it in GitHub Desktop.
Save devcfgc/61205be17843ce792d1b to your computer and use it in GitHub Desktop.
Puppet tips
#Avoid duplicate declaration https://docs.puppet.com/puppet/latest/reference/lang_collectors.html
File <| title == 'folder_name' |> {
ensure => directory
}
#Symbolic links
file { '/etc/apache2/sites-enabled/001-puppet-lore.org':
ensure => 'link',
target => '../sites-available/puppet-lore.org',
}
#Regex replacement (replace the last '/' with '/folder')
$logstore= ['/data/disk2/']
regsubst($logstore, '\/[^\/]*$', '/folder')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment