Skip to content

Instantly share code, notes, and snippets.

@trlinkin
Last active October 14, 2016 13:55
Show Gist options
  • Select an option

  • Save trlinkin/285a1c6af412134f1eff7a677c84b0a9 to your computer and use it in GitHub Desktop.

Select an option

Save trlinkin/285a1c6af412134f1eff7a677c84b0a9 to your computer and use it in GitHub Desktop.
case $facts['os']['family'] {
'debian': {
$x11_pkg = 'xorg'
$ssh_pkg = 'ssh'
}
'solaris': {
$x11_pkg = 'x11/server/xorg'
$ssh_pkg = 'network/ssh'
}
'windows': {
$x11_pkg = 'xming'
$ssh_pkg = 'putty'
}
'redhat': {
$x11_pkg = 'xorg-x11-server-Xorg'
$ssh_pkg = ['openssh', 'openssh-clients', 'openssh-server']
}
default: {
fail("Operating system family ${::osfamily} is not supported.")
}
}
class foo {
file { '/tmp/ipaddr':
ensure => file,
content => "The IP is: ${facts['networking']['interfaces']['eth0']['ip']}",
}
}
$packages = ['foo-util', 'rsyslog']
package { $packages:
ensure => installed,
}
service { 'syslog':
ensure => running,
enable => true,
require => [ File['/etc/rsyslog.conf'], Package[$packages], User['tom','services-user'] ],
}
$arr = [1, 2, [3 ,4, [5, 6]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment