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 "1 imported" | |
import "2.pp" |
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
# /etc/puppetlabs/puppet/users/init.pp | |
class users { | |
$users_list = hiera('users::users_list') | |
users::user { $users_list: } | |
} |
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
use console_inventory_service; | |
select r.restype 'Resource',r.title 'Title',h.name 'Exporting Host' | |
from resources as r | |
left join hosts as h on h.id = r.host_id | |
where r.exported=1 |
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
package { 'A': | |
ensure => $version, | |
} | |
if $::package_a_version != $version { | |
exec { 'do something reasonable': | |
subscribe => Package['A'], | |
notify => Resource['the_next_thing'], | |
} | |
} |
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 |
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
{ | |
"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
$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
# 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
new_hash = Hash.new | |
hash_table.each_value do |val| | |
new_hash[val['group']] ||= Array.new | |
new_hash[val['group']] << val['fqdn'] | |
end |