Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'fheinle-ddns', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
ddnsv6
This module will install ddnsv6, a client/server-combo that collects ipv6 addresses from hosts and uploads those as AAAA
records to CloudFlare.
Table of Contents
Setup
What ddnsv6 affects
- Checks out the git repo and installs ruby dependencies
- Creates a system user
- Creates config files on server and client hosts
- Creates a whitelist on the server that contains all client hostnames
- Installs a cronjob on the client that uploads IPs and a cronjob on the server that updates
AAAA
-record
Setup requirements
- (At least) two hosts: one server and (at least) one client
- IPv6 connectivity in your network
- working PuppetDB
- CloudFlare account that manages DNS for a domain
- Strongly recommended: webserver that handles SSL termination and authentication
Usage
This is a basic puppet manifest that will install client and server when included for your hosts:
$ddns_server = lookup('ddns::ddns_server', String)
$client_password = lookup('ddns::client_password', String)
$cloudflare_user = lookup('ddns::cloudflare_user', String)
$cloudflare_password = lookup('ddns::cloudflare_password', String)
include ::ddns
if $install_client == true {
class { '::ddns::client':
ddns_server => $ddns_server,
client_password => $client_password,
}
} elsif $install_server == true {
class { ':ddns::server':
domain_whitelist = [$facts['domain']],
cloudflare_user = $cloudflare_user,
cloudflare_password = $cloudflare_password
}
}
The variables referenced at the manifest's head need to be set in Hiera, of course. Additionally, in order to use authentication and SSL, a webserver that serves the server's sinatra web app needs to be set up (out of scope for this README).
Reference
Class ::ddns
Handles basic installation, creates the system user, checks out the tool's github repo and installs ruby dependencies.
Attributes:
install_directory
(String): Where to check out the script repoinstall_repo
(String): Repo URL to check outinstall_version
(String): Git branch name, tag name or revision to check outddns_user
(String): Username that should be used for the scriptcreate_ddns_user
(Boolean): Whether to create the system user. Iffalse
, needs to be created somewhere else (maybe with your directory services)
Class ::ddns::client
Configures the client, creates the client's cronjob and the whitelist fragment for the host.
Attributes:
ddns_server
(String): Hostname for communication with the serverddns_server_ssl
(Boolean) Default:true
: Whether to use SSL for communication with the serverddns_server_port
(Integer) Default:443
: Port number to use for communication with the serverclient_username
(String) Default:ddns
: Username for HTTP authenticationclient_password
(String): Password for HTTP authenticationipv6_prefix
(String): IPv6 prefix the address must match to be transmitted to the server (without network part, e.g.2001
)
Class ::ddns::server
Configures the server, installs ruby dependencies for the server, installs the worker's cronjob and creates the host whitelist.
Attributes:
domain_whitelist
(Array): List of domains that are managed by the servercloudflare_user
(String): CloudFlare usernamecloudflare_password
(String): CloudFlare API-Keyipv6_prefix
(String): IPv6 prefix the address must match to be transmitted to the server (without network part, e.g.2001
)
Limitations
- Currently the setup only cares about authentication but not about authorization. I.e. there's no checks if hosts that send update notices to the server are actually allowed to send those updates. This setup assumes the clients are trustworthy.
- Webserver vhost creation for handling SSL and authentication must be done separately.
Links
MIT License Copyright (c) 2018 Florian Heinle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.