inkblot / puppet-bind

18 stars 82 forks source link

Don't remove confdir files this remove standard files #52

Closed nerzhul closed 9 years ago

nerzhul commented 9 years ago

If we remove confdir files all the Debian standard files are purged and bind doesn't work

inkblot commented 9 years ago

What specific files should be retained?

nerzhul commented 9 years ago

Debian files are deleted in my configuration then bind doesn't start

inkblot commented 9 years ago

Can you please send the output of puppet removing these files?

nerzhul commented 9 years ago

I haven't it now, i'm at home but in the scenario this is what it happens: bind package install => bind directory cleanup => configuration by puppet-bind of all files => starting bind => not working (debian included files have been removed by cleanup and includes aren't resolved).

inkblot commented 9 years ago

In agent mode, puppet logs to /var/log/syslog. You can find the output there.

nerzhul commented 9 years ago

Info: Computing checksum on file /etc/bind/named.conf.default-zones Info: /Stage[main]/Bind/File[/etc/bind/named.conf.default-zones]: Filebucketed /etc/bind/named.conf.default-zones to main with sum cf3c6c70e70516e6b3af112dd0a1907c Notice: /Stage[main]/Bind/File[/etc/bind/named.conf.default-zones]/ensure: removed Info: Computing checksum on file /etc/bind/db.0 Info: /Stage[main]/Bind/File[/etc/bind/db.0]: Filebucketed /etc/bind/db.0 to main with sum 8aba258068c8c60a7ade3952a285f57d Notice: /Stage[main]/Bind/File[/etc/bind/db.0]/ensure: removed Info: Computing checksum on file /etc/bind/db.127 Info: /Stage[main]/Bind/File[/etc/bind/db.127]: Filebucketed /etc/bind/db.127 to main with sum 64f5cf50e8d8192109dad43b779e5e36 Notice: /Stage[main]/Bind/File[/etc/bind/db.127]/ensure: removed Info: Computing checksum on file /etc/bind/db.root Info: /Stage[main]/Bind/File[/etc/bind/db.root]: Filebucketed /etc/bind/db.root to main with sum b3b07a2944d29d1f5bd58fe2fe183148 Notice: /Stage[main]/Bind/File[/etc/bind/db.root]/ensure: removed Info: Computing checksum on file /etc/bind/db.local Info: /Stage[main]/Bind/File[/etc/bind/db.local]: Filebucketed /etc/bind/db.local to main with sum e5d27ead2d238928a08d33c7a7333477 Notice: /Stage[main]/Bind/File[/etc/bind/db.local]/ensure: removed Info: Computing checksum on file /etc/bind/db.empty Info: /Stage[main]/Bind/File[/etc/bind/db.empty]: Filebucketed /etc/bind/db.empty to main with sum 4e7a0ebff9a8936e5a72ec18c0c49214 Notice: /Stage[main]/Bind/File[/etc/bind/db.empty]/ensure: removed Info: Computing checksum on file /etc/bind/db.255 Info: /Stage[main]/Bind/File[/etc/bind/db.255]: Filebucketed /etc/bind/db.255 to main with sum 8aba258068c8c60a7ade3952a285f57d Notice: /Stage[main]/Bind/File[/etc/bind/db.255]/ensure: removed Info: /etc/bind: Scheduling refresh of Service[bind] Error: /Stage[main]/Bind/Service[bind]: Failed to call refresh: Could not restart Service[bind]: Execution of '/etc/init.d/bind9 restart' returned 1: Stopping domain name service...: bind9 waiting for pid 15738 to die. Starting domain name service...: bind9 failed! Error: /Stage[main]/Bind/Service[bind]: Could not restart Service[bind]: Execution of '/etc/init.d/bind9 restart' returned 1: Stopping domain name service...: bind9 waiting for pid 15738 to die. Starting domain name service...: bind9 failed!

inkblot commented 9 years ago

What does facter osfamily operatingsystem lsbdistrelease output on this system? Are there any other messages in the puppet logs related to the bind module?

nerzhul commented 9 years ago

There is no other puppet messages , i'll give you facter informations tomorrow

inkblot commented 9 years ago

I am confused about the removal of these files because on a Debian system, these are explicitly retained:

from manifests/init.pp

    file { $::bind::params::bind_files:
        ensure  => present,
    }

from manifests/params.pp

    if $::osfamily == 'Debian' {
        $bind_files = [
            "${::bind::confdir}/bind.keys",
            "${::bind::confdir}/db.empty",
            "${::bind::confdir}/db.local",
            "${::bind::confdir}/db.root",
            "${::bind::confdir}/db.0",
            "${::bind::confdir}/db.127",
            "${::bind::confdir}/db.255",
            "${::bind::confdir}/named.conf.default-zones",
            "${::bind::confdir}/zones.rfc1918",
        ]
    }
nerzhul commented 9 years ago

Hello, here is the facter variables

osfamily => Debian operatingsystem => Debian operatingsystemmajrelease => 6 operatingsystemrelease => 6.0.10 lsbdistrelease => 6.0.10

nerzhul commented 9 years ago

I also agree with the surprise, i didn't understand why is this happening , but it happens every time

inkblot commented 9 years ago

What parameters are you supplying to the bind class?

nerzhul commented 9 years ago
    class { 'bind::params':
            supported => true,
            bind_user => 'bind',
            bind_group => 'bind',
            bind_package => 'bind9',
            bind_service => 'bind9',
            nsupdate_package => 'bind9utils'
    }

    class { 'bind':
            rndc => true,
            confdir => '/etc/bind',
            cachedir => '/var/lib/bind',
            namedconf => '/etc/bind/named.conf',
            forwarders => $forwarders,
    }
inkblot commented 9 years ago

It should not be necessary to supply values for confdir, cachedir, or namedconf. These and other are given default values via hiera. Do you have the bind module's dependencies installed?

From metadata.json:

  "dependencies": [
    { "name": "puppetlabs/stdlib" },
    { "name": "puppetlabs/concat", "version_requirement": ">=1.0.0 <2.0.0" },
    { "name": "ripienaar/module_data" }
  ]

In particular the module_data module is what makes the data directory in this module work.

nerzhul commented 9 years ago

I added module_data dependancy and i have the same result: Notice: /File[/var/lib/puppet/lib/puppet/indirector]/ensure: created Notice: /File[/var/lib/puppet/lib/puppet/indirector/data_binding]/ensure: created Notice: /File[/var/lib/puppet/lib/hiera]/ensure: created Notice: /File[/var/lib/puppet/lib/puppet/indirector/data_binding/hiera.rb]/ensure: defined content as '{md5}9a67f431134c49f86fa686b116718806' Notice: /File[/var/lib/puppet/lib/hiera/backend]/ensure: created Notice: /File[/var/lib/puppet/lib/hiera/backend/module_data_backend.rb]/ensure: defined content as '{md5}8f9da7dd8e7d02fb7beac72f187ad874'

Notice: /Stage[main]/Bind/File[/etc/bind/named.conf.default-zones]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.0]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.127]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.root]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.local]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.empty]/ensure: current_value file, should be absent (noop) Notice: /Stage[main]/Bind/File[/etc/bind/db.255]/ensure: current_value file, should be absent (noop)

inkblot commented 9 years ago

In that output, I see module_data code being installed. If you allow these to happen but prevent the file removals, do the file removals continue to happen on later puppet runs?

nerzhul commented 9 years ago

yes, :(

inkblot commented 9 years ago

I am still stumped by this issue. I am leaning toward accepting your change, but with additional work to dismantle the lists of exclusions in bind::params. I'll probably do this tomorrow morning.

inkblot commented 9 years ago

This pull request is included in version 4.3.0 published to the forge.

nerzhul commented 9 years ago

@inkblot thanks you a lot !