- Description
- Compatibility
- Getting Started
- Usage - Configuration options and additional functionality
- More Information
- Development
Namikoda provides an easy interface for getting configuration values consistent across your physical and cloud infrastructure. We focus on providing IP range data and the tooling to act on it. Confidently use human-readable tags instead of lists of IPs in your configuration.
This module is an interface between puppet and the Namikoda API.
This module was developed against Puppet 4. It's unlikely to work with any prior version.
If you haven't yet, generate an API key at https://manage.namikoda.com. See the registration documentation for the step-by-step process.
Once you have an API key, add a line in your sites.pp
or equivalent to tell the namikoda library what it is.
namikoda::set_apikey("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
That will let the library set the right headers in the REST calls.
The namikoda::ipv4sfor()
function takes one parameter, the ID of the site that you're trying to get the IPs for. It returns an array of strings. Each string is a CIDR-encoded IPv4 range.
notice (namikoda::ipv4sfor('github'))
# Logs [ 185.199.108.0/22, 192.30.252.0/22 ]
The namikoda::ipv6sfor()
function takes one parameter, the ID of the site that you're trying to get the IPs for. It returns an array of strings. Each string is a CIDR-encoded IPv6 range.
notice (namikoda::ipv6sfor('github'))
# Logs [ 2620:112:3000::/44 ]
The namikoda::value()
function takes one parameter, the ID of the site that you're trying to get the IPs for. It returns an array of strings. Each string is a CIDR-encoded IP range, combining both the IPv4 and IPv6 ranges above.
notice (namikoda::value('github'))
# Logs [ 185.199.108.0/22, 192.30.252.0/22, 2620:112:3000::/44 ]
This module integrates well with puppetlabs/firewall. Assuming that the firewall module is imported, you can iterate over the ranges returned by one of the functions above and create rules as you see fit.
For example:
each( namikoda::ipv4sfor('github') ) |$subnet| {
firewall { "006 Allow inbound HTTP from github webhook subnet $subnet":
dport => 80,
proto => tcp,
action => accept,
source => $subnet,
}
}
See https://docs.namikoda.com for more detailed information about Namikoda and what sites are available.
We love PRs! Head over to https://github.com/namikoda/puppet and fork away.