Skip to content

Instantly share code, notes, and snippets.

@strobert
Created February 12, 2013 22:37
Show Gist options
  • Save strobert/4774137 to your computer and use it in GitHub Desktop.
Save strobert/4774137 to your computer and use it in GitHub Desktop.
puppet calling_class/module_name with hiera
strobenet::test2::dropIPs:
- CLASSESmodulename
strobenet::test2::dropIPs:
- GLOBALfallback
Notice: calling_class1:
Notice: /Stage[main]/Strobenet::Test2/Notify[calling_class1: ]/message: defined 'message' as 'calling_class1: '
Notice: calling_class3: %{calling_class}
Notice: /Stage[main]/Strobenet::Test2/Notify[calling_class3: %{calling_class}]/message: defined 'message' as 'calling_class3: %{calling_class}'
Notice: dropIPs: GLOBALfallback
Notice: /Stage[main]/Strobenet::Test2/Notify[dropIPs: GLOBALfallback]/message: defined 'message' as 'dropIPs: GLOBALfallback'
Notice: d2: GLOBALfallback
Notice: /Stage[main]/Strobenet::Test2/Notify[d2: GLOBALfallback]/message: defined 'message' as 'd2: GLOBALfallback'
Notice: calling_class2:
Notice: /Stage[main]/Strobenet::Test2/Notify[calling_class2: ]/message: defined 'message' as 'calling_class2: '
Notice: d3: strobenet
Notice: /Stage[main]/Strobenet::Test2/Notify[d3: strobenet]/message: defined 'message' as 'd3: strobenet'
Notice: calling_class4: %{::calling_class}
Notice: /Stage[main]/Strobenet::Test2/Notify[calling_class4: %{::calling_class}]/message: defined 'message' as 'calling_class4: %{::calling_class}'
Notice: Finished catalog run in 0.17 seconds
class strobenet::test2 (
$loopbackIP,
$publicIP0,
$publicIP1,
$dropIPs = undef,
) {
# package { 'iptables':
# ensure => 'present',
# }
#
# service { 'iptables':
# ensure => running,
# enable => true,
# hasrestart => true,
# }
$d2 = hiera(strobenet::test2::dropIPs)
notify { "dropIPs: ${dropIPs}": }
notify { "d2: ${d2}": }
notify { "d3: ${module_name}": }
notify { "calling_class1: ${calling_class}": }
notify { "calling_class2: ${::calling_class}": }
notify { "calling_class3: %{calling_class}": }
notify { "calling_class4: %{::calling_class}": }
file { 'sysconfig-iptables':
ensure => file,
path => '/etc/sysconfig/iptables',
content => template('strobenet/sysconfig-iptables'),
# require => Package['iptables'],
# notify => Service['iptables'],
}
}
strobenet::test2::dropIPs:
- modulename
│#-A DROP-INPUT -s GLOBALfallback -j REJECT --reject-with icmp-host-prohibited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment