Last active
October 14, 2016 13:55
-
-
Save trlinkin/285a1c6af412134f1eff7a677c84b0a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class foo { | |
| file { '/tmp/ipaddr': | |
| ensure => file, | |
| content => "The IP is: ${facts['networking']['interfaces']['eth0']['ip']}", | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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