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
| $hosts = ['hosta','hostb','hostc'] | |
| range(0,count($hosts)-1).each |$num| { | |
| $port = 8080 + $num | |
| somemodule::someservice { $hosts[$num]: | |
| listening_port => $port, | |
| } | |
| } |
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
| Notice: Scope(Class[main]): String | |
| Notice: Compiled catalog for stout.4c in environment production in 0.03 seconds | |
| Notice: Finished catalog run in 0.02 seconds |
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
| --- | |
| parent::params: | |
| - example1 | |
| - example2 |
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 parent1 { | |
| include child1 | |
| anchor { 'parent1::start': } -> | |
| Class['child1'] -> | |
| anchor { 'parent1'::end': } | |
| } | |
| class parent2 { | |
| include child2 | |
| anchor { 'parent2::start': } -> |
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
| new_hash = Hash.new | |
| hash_table.each_value do |val| | |
| new_hash[val['group']] ||= Array.new | |
| new_hash[val['group']] << val['fqdn'] | |
| end |
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
| # Run the puppet agent hourly | |
| cron { 'run puppet agent': | |
| command => '/opt/puppet/bin/puppet agent -t', | |
| user => 'root', | |
| minute => fqdn_rand(60), | |
| } |
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_val = 'CamelCase' | |
| $select_val = 'CamelCase' | |
| case $case_val { | |
| 'camelcase': { | |
| $case_str = 'not case sensitive' | |
| } | |
| 'CamelCase': { | |
| $case_str = 'case sensitive' | |
| } |
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
| { | |
| "ntp::restrict" : false, | |
| "ntp::autoupdate" : false, | |
| "ntp::enable" : true, | |
| "ntp::servers" : [ | |
| "0.us.pool.ntp.org iburst", | |
| "1.us.pool.ntp.org iburst", | |
| "2.us.pool.ntp.org iburst", | |
| "3.us.pool.ntp.org iburst" | |
| ] |
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
| $base_packages = [ | |
| 'git', | |
| 'tmux', | |
| 'weechat', | |
| 'nginx', | |
| 'monit', | |
| 'sshd', | |
| ] | |
| package { $base_packages: |
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
| notice: /Stage[main]//File[/tmp/${::uptime_seconds}]/ensure: created | |
| err: /Stage[main]//Service[fail_on_refresh]: Failed to call refresh: Could not restart Service[fail_on_refresh]: Execution of '/bin/false' returned 1: at /root/service.pp:12 | |
| notice: /Stage[main]//File[/tmp/doesnt_exist]/ensure: created | |
| notice: Finished catalog run in 0.07 seconds |