systemd_service

The systemd_service module allows you to manage a systemd service on a target server.

Arguments

  • name: a string that contains the name of the service to be managed.
  • action: a string that specifies the action to be taken on the service. (default is start. Supported actions: start, stop, restart, reload, enable, disable)
  • daemon_reload: a boolean that indicates whether to reload the systemd daemon before taking the action. (default is false)
  • force: a boolean that indicates whether to force the action to be taken. (default is false)

Usage Example

local task = {
    name = "Restart apache2 service",
    komandan.modules.systemd_service({
        name = "apache2.service",
        action = "restart",
    })
}

komandan.komando(host, task)