Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 14.4.5 #218

Closed
vandelin586 opened this issue Apr 30, 2017 · 5 comments
Closed

Ubuntu 14.4.5 #218

vandelin586 opened this issue Apr 30, 2017 · 5 comments

Comments

@vandelin586
Copy link

Seems that the params class for my ubuntu server is looking towards the RedHat case?

Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/named/named.conf.options20170430-6632-r7aqg0.lock at /etc/puppetlabs/code/environments/develop/modules/dns/manifests/server/options.pp:198
Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/named/named.conf.options20170430-6632-r7aqg0.lock at /etc/puppetlabs/code/environments/develop/modules/dns/manifests/server/options.pp:198
Wrapped exception:
No such file or directory @ dir_s_mkdir - /etc/named/named.conf.options20170430-6632-r7aqg0.lock

Error: /Stage[main]/Profile::Nameserver/Dns::Server::Options[/etc/named/named.conf.options]/File[/etc/named/named.conf.options]/ensure: change from absent to present failed: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/named/named.conf.options20170430-6632-r7aqg0.lock at /etc/puppetlabs/code/environments/develop/modules/dns/manifests/server/options.pp:198
Notice: /Stage[main]/Dns::Server::Service/Service[bind9]: Dependency File[/etc/named/named.conf.options] has failures: true
Warning: /Stage[main]/Dns::Server::Service/Service[bind9]: Skipping because of failed dependencies

server facts:

os => {
architecture => "amd64",
distro => {
codename => "trusty",
description => "Ubuntu 14.04.5 LTS",
id => "Ubuntu",
release => {
full => "14.04",
major => "14.04"
}
},
family => "Debian",
hardware => "x86_64",
name => "Ubuntu",
release => {
full => "14.04",
major => "14.04"
},
selinux => {
enabled => false
}

@ghost
Copy link

ghost commented Apr 30, 2017

Which version of ajjahn-dns are you using?

@ghost
Copy link

ghost commented Apr 30, 2017

Also, please include your Profile::Nameserver class, so we can see how you're invoking dns::server::options.

@vandelin586
Copy link
Author

version 2.1.0

class profile::nameserver(
Hash $options,
Hash $zones,
Hash $a_records,
Hash $cname_records,
) {
class { '::dns::server': }

Build records

create_resources('dns::server::options', $options)
create_resources('dns::zone', $zones)
create_resources('dns::record::a', $a_records)
create_resources('dns::record::cname', $cname_records)
}

@vandelin586
Copy link
Author

inside nameserver.yaml
profile::nameserver::options:
/etc/bind/named.conf.options: <-- this was set to /etc/named > I correct this to Debian path but this is not a long term solution, how can I get it to choose based on OSfamily?

Its not the module , it was how I am calling dns::server::options

@ghost
Copy link

ghost commented May 2, 2017

You can't change it based on OSfamily entirely within Hiera - you need puppet logic.

What you can do is move the options "up" a level and feed it in properly in the profile:

profile::nameserver::options:
    forwarders:
        - 8.8.8.8
        - 8.8.4.4

class profile::nameserver(
    Hash $options,
    Hash $zones,
    Hash $a_records,
    Hash $cname_records,
) {
    class { '::dns::server': }
    # Build records
    include dns::server::params
    create_resources('dns::server::options', {
            "${dns::server::params::cfg_dir}/named.conf.options" => $options
        })
    create_resources('dns::zone', $zones)
    create_resources('dns::record::a', $a_records)
    create_resources('dns::record::cname', $cname_records)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant