added hiera data for nameservers and configured resolv profile

This commit is contained in:
christopher.lawrence 2020-02-04 14:45:29 +00:00
parent bd5a987e92
commit 1d55cd96ce
3 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,8 @@
---
message: "This node is using common data"
profiles::base::dns::nameservers: 8.8.8.8
profile::base::resolv: true
profile::base::resolv::nameservers:
- '8.8.8.8'
- '127.0.0.1'
profile::base::resolv::domainname: home

View File

@ -4,7 +4,7 @@ class profile::base (
Boolean $ntp = false,
Boolean $puppet = false,
Boolean $repos = false,
Boolean $resolver = false,
Boolean $resolv = false,
Boolean $ssh = true,
Boolean $selinux = true,
Boolean $motd = true,
@ -27,8 +27,8 @@ class profile::base (
if $repos {
class { '::profile::base::repositories': }
}
if $resolver {
class { '::profile::base::resolver': }
if $resolv {
class { '::profile::base::resolv': }
}
if $ssh {
class { '::profile::base::ssh': }

View File

@ -0,0 +1,17 @@
# This class can be used to configure resolv.conf.
#
# @example when declaring the resolver class
# class { '::profiles::base::resolv': }
#
class profile::base::resolv (
Optional[String] $domainname = undef,
Array[String] $nameservers = [],
Optional[String] $searchpath = undef,
) {
class { '::resolv_conf':
domainname => $domainname,
nameservers => $nameservers,
searchpath => $searchpath,
}
}