Skip to content

Instantly share code, notes, and snippets.

@anarcat
Last active September 5, 2019 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anarcat/854d64c26a3f2e2ae7d3fd5292245404 to your computer and use it in GitHub Desktop.
Save anarcat/854d64c26a3f2e2ae7d3fd5292245404 to your computer and use it in GitHub Desktop.
class base(
Stdlib::IP::Address $public_address = filter_ipv4(getfromhash($nodeinfo, 'ldap', 'ipHostNumber'))[0],
Stdlib::IP::Address $public_address6 = filter_ipv6(getfromhash($nodeinfo, 'ldap', 'ipHostNumber'))[0],
) {
Notify { 'base_ips':
message => "base::public_address: ${base::public_address} base::public_address6: ${base::public_address6} ipaddress: ${::ipaddress} ipaddress6: ${::ipaddress6}",
}
}
classes:
- roles::weblog_source
- roles::static_mirror_web
# doesn't know its own IP, supply it here
# XXX: maybe we want to override ipaddress for this entire host?
roles::weblog_source::allow_address: 89.45.235.27
roles::static_master::allow_address: 89.45.235.27
# behind NAT
hosts::managed: false
classes:
- roles::monitored
- base
---
:backends:
- yaml
:hierarchy:
- "nodes/%{trusted.certname}"
- "osfamily/%{::osfamily}"
# forward-compatibility with automated lookups, remove when
# Puppetmaster is >= 4.9, along with the symlinks in hiera/modules
- "modules/%{module_name}/data/%{facts.os.name}-%{facts.os.release.major}"
- "modules/%{module_name}/data/%{facts.os.name}"
- "modules/%{module_name}/data/%{facts.os.family}"
- "modules/%{module_name}/data/defaults"
- "modules/%{module_name}/data/common"
- common
:yaml:
:datadir: /etc/puppet/hiera
# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for cdn-backend-sunet-01.torproject.org
Info: Applying configuration version '1567714440'
Notice: base::public_address: base::public_address6: ipaddress: 89.45.235.27 ipaddress6: 2001:6b0:5a:5000::b allow_address 89.45.235.27 allow_address6 2001:6b0:5a:5000::b
Notice: /Stage[main]/Roles::Weblog_source/Notify[weblog_source_ips]/message: defined 'message' as 'base::public_address: base::public_address6: ipaddress: 89.45.235.27 ipaddress6: 2001:6b0:5a:5000::b allow_address 89.45.235.27 allow_address6 2001:6b0:5a:5000::b'
Notice: base::public_address: 89.45.235.27 base::public_address6: 2001:6b0:5a:5000::b ipaddress: 89.45.235.27 ipaddress6: 2001:6b0:5a:5000::b
Notice: /Stage[main]/Base/Notify[base_ips]/message: defined 'message' as 'base::public_address: 89.45.235.27 base::public_address6: 2001:6b0:5a:5000::b ipaddress: 89.45.235.27 ipaddress6: 2001:6b0:5a:5000::b'
Notice: Applied catalog in 5.12 seconds
class roles::weblog_source(
$allow_address = $::ipaddress,
$allow_address6 = $::ipaddress6,
) {
Notify { 'weblog_source_ips':
message => "base::public_address: ${base::public_address} base::public_address6: ${base::public_address6} ipaddress: ${::ipaddress} ipaddress6: ${::ipaddress6} allow_address ${allow_address} allow_address6 ${allow_address6}",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment