Skip to content

Systemd fails to restart DHCP & DNS services when creating Cobbler resources #6419

@thijsschnitger

Description

@thijsschnitger

When I use Cobbler to manage DHCP and DNS, even with as few as 7 systems systemd fails to restart these services repeatedly and as a result does not keep them running:

systemd: start request repeated too quickly for dhcpd.service
systemd: Failed to start DHCPv4 Server Daemon.
systemd: Unit dhcpd.service entered failed state.
systemd: dhcpd.service failed.
(...)
systemd: start request repeated too quickly for named-setup-rndc.service
systemd: Failed to start Generate rndc key for BIND (DNS).
systemd: Unit named-setup-rndc.service entered failed state.
systemd: named-setup-rndc.service failed.
systemd: start request repeated too quickly for named.service
systemd: Failed to start Berkeley Internet Name Domain (DNS).
systemd: Unit named.service entered failed state.
systemd: named.service failed.

Terraform apply fails with the error:

Cobbler System: Error syncing system: error: "<class 'cobbler.cexceptions.CX'>:'cobbler trigger failed: cobbler.modules.sync_post_restart_services'" code: 1

Terraform Version

Terraform v0.6.15

Affected Resource(s)

cobbler_system

Terraform Configuration Files

provider "cobbler" {
  url      = "http://1.2.3.4/cobbler_api"
  username = "cobbler"
  password = "cobbler"
}
resource "cobbler_system" "server" {
  count           = "9"
  profile         = "centos7-x86_64"
  name            = "server-${count.index}"
  hostname        = "server-${count.index}.mydomain.com"
  gateway         = "1.2.3.1"
  kickstart       = "/var/lib/cobbler/kickstarts/sample_end.ks"
  name_servers    = ["8.8.8.8", "1.2.3.4"]
  netboot_enabled = "1"
  interface {
    name        = "eth0"
    mac_address = "11:22:33:44:55:0${count.index}"
    ip_address  = "1.2.4.${count.index}"
    netmask     = "255.255.255.0"
    dns_name     = "server-${count.index}.mydomain.com"
    static      = true
  }
}

Debug Output

Panic Output

Expected Behavior

Resources created successfully

Actual Behavior

Error applying plan:

2 error(s) occurred:

  • cobbler_system.server.2: Cobbler System: Error syncing system: error: "<class 'cobbler.cexceptions.CX'>:'cobbler trigger failed: cobbler.modules.sync_post_restart_services'" code: 1
  • cobbler_system.server.1: Cobbler System: Error syncing system: error: "<class 'cobbler.cexceptions.CX'>:'cobbler trigger failed: cobbler.modules.sync_post_restart_services'" code: 1

Steps to Reproduce

  1. terraform apply

Important Factoids

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions