Skip to content

Instantly share code, notes, and snippets.

@raphink
Created May 27, 2014 12:16
Show Gist options
  • Select an option

  • Save raphink/feb706303ce700992a8c to your computer and use it in GitHub Desktop.

Select an option

Save raphink/feb706303ce700992a8c to your computer and use it in GitHub Desktop.
Shared hosts entries with puppetdbquery
define shared_host (
$ipaddress,
$fqdn,
$hostname,
) {
host { $fqdn:
ip => $ipaddress,
host_aliases => $hostname,
}
}
$hosts = query_facts('Class["settings"]', ['hostname', 'fqdn', 'ipaddress'])
create_resources('shared_host', $hosts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment