Skip to content

Ability to specify the desired service state #12

@adoom42

Description

@adoom42

I run netbox in two data centers - one active and the other standby. PostgreSQL replication mirrors the DB from the active to the standby DC, and the DB is read-only in the standby DC. Because of this, I only want the netbox service to be running in the active colo - it should be stopped in the standby colo.

The active parameters of the systemd services are set statically right now:

systemd::unit_file { 'netbox-rq.service':
content => epp('netbox/netbox-rq.service.epp', $service_params_netbox_rq),
enable => true,
active => true,
}
systemd::unit_file { 'netbox.service':
content => epp('netbox/netbox.service.epp', $service_params_netbox),
enable => true,
active => true,
}

Please add a class parameter so it may be overridden. I'm doing it manually like this right now:

  # override some so services are stopped in the standby DC
  $active = custom_function::am_i_in_the_active_dc() ? {
    'yes'     => true,
    default   => false,
  }
  Systemd::Unit_file <| title == 'netbox.service' |> {
    active => $active,
  }
  Systemd::Unit_file <| title == 'netbox-rq.service' |> {
    active => $active,
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions