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

Ordering for File['/etc/named.conf'] and Package[bind] is incorrect #43

Closed
rnelson0 opened this issue Dec 31, 2014 · 4 comments
Closed

Comments

@rnelson0
Copy link

I encountered the following issue during an apply on a CentOS 6.5 VM:

Info: Applying configuration version '1420044267'
Notice: /Stage[main]/Main/Node[default]/Ssh_authorized_key[rnelson0@putty]/ensure: created
Notice: /Stage[main]/Profile::Dns/Bind::Server::Conf[/etc/named.conf]/File[/etc/named.conf]/ensure: defined content as '{md5}a5141af2b722e6558974d95a5262576f'
Info: /Stage[main]/Profile::Dns/Bind::Server::Conf[/etc/named.conf]/File[/etc/named.conf]: Scheduling refresh of Class[Bind::Service]
Error: Could not set 'directory' on ensure: Could not find group named at 60:/etc/puppet/environments/sshgw/modules/bind/manifests/server/file.pp
Error: Could not set 'directory' on ensure: Could not find group named at 60:/etc/puppet/environments/sshgw/modules/bind/manifests/server/file.pp
Wrapped exception:
Could not find group named
...
Notice: /Stage[main]/Bind::Package/Package[bind]/ensure: created
Notice: /Stage[main]/Profile::Dns/Bind::Server::File[named.nelson.va]/File[/var/named/named.nelson.va]: Dependency File[/var/named] has failures: true
Warning: /Stage[main]/Profile::Dns/Bind::Server::File[named.nelson.va]/File[/var/named/named.nelson.va]: Skipping because of failed dependencies
Notice: /Stage[main]/Bind/File[/var/log/named]/ensure: created
Notice: /Stage[main]/Profile::Dns/Bind::Server::File[named.0.0.10]/File[/var/named/named.0.0.10]: Dependency File[/var/named] has failures: true
Warning: /Stage[main]/Profile::Dns/Bind::Server::File[named.0.0.10]/File[/var/named/named.0.0.10]: Skipping because of failed dependencies
Info: Class[Bind::Service]: Scheduling refresh of Service[named]
Notice: /Stage[main]/Bind::Service/Service[named]: Dependency File[/var/named] has failures: true
Warning: /Stage[main]/Bind::Service/Service[named]: Skipping because of failed dependencies
Notice: /Stage[main]/Bind::Service/Service[named]: Triggered 'refresh' from 1 events

The file is managed early in the run (lines 14-15) and the package is added later (line 101) followed by the other settings (102-110). A second run results in a working config, so the issue is simply one of ordering.

@rnelson0
Copy link
Author

The calling class looks like this:

class profile::dns {
  # Named package and configs
  include bind
  $bind_server_confs = hiera_hash('bind_server_confs', undef)
  if ($bind_server_confs) {
    create_resources('bind::server::conf', $bind_server_confs)
  }
  $bind_server_files = hiera_hash('bind_server_files', undef)
  if ($bind_server_files) {
    create_resources('bind::server::file', $bind_server_files)
  }
}

The hiera data looks like this:

bind_server_confs:
  '/etc/named.conf':
    listen_on_addr:
      - '127.0.0.1'
      - '10.0.0.253'
    allow_query:
      - 'localhost'
      - '10.0.0.0/24'
    zones:
      0.0.10.in-addr.arpa:
        - 'type master'
        - 'file "named.0.0.10"'
        - 'allow-update { none; }'

This was referenced Dec 31, 2014
@rnelson0
Copy link
Author

@thias I tested this in my lab, the PR is ready for review.

@grosscol
Copy link

I ran into a similar issue on a Debian install.

@thias
Copy link
Owner

thias commented Apr 23, 2018

I'll go with the simpler fix from #71 for now. Do feel free to create a PR about only rspec that can be reviewed independently from other changes.

@thias thias closed this as completed Apr 23, 2018
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

3 participants