Services

Synopsis

The dictionary cl_services comprises managed services.

Parameters

Parameter

Type

Comments

name

string required

Name of the service.

state

string

State of the service. default: started (Linux) default: start (FreeBSD)

enabled

boolean

Start on boot. default: true

See also

Note

Depending on the OS, see the Ansible modules *.service what values are allowed.

FreeBSD

rc.conf

In FreeBSD, the services are configured in /etc/rc.conf by default

cl_rcconfd: false

If you want to use /etc/rc.conf.d set

cl_rcconfd: true

By default, the parameter name is used as the filename

cl_rcconfd_path:
  default: "{{ cl_rcconfd_dir }}/{{ _service }}"

where

_service: "{{ item.value.name }}"

rcvar

By default, the parameter name is used to create a rcvar

cl_rcconf_rcvar:
  default: "{{ _service }}_enable"
  devfs: devfs_load_rulesets

See also

  • The tasks services.yml

  • The role defaults defaults/main.yml

Examples

FreeBSD services for Postfix and Sendmail

[contrib/postfix/conf-light/service.d/postfix.yml]

1---
2postfix:
3  name: postfix
4  state: "{{ cl_service_postfix_state }}"
5  enabled: "{{ cl_service_postfix_enable }}"

[contrib/postfix/conf-light/service.d/sendmail.yml]

1---
2sendmail:
3  name: sendmail
4  state: "{{ cl_service_sendmail_state }}"
5  enabled: "{{ cl_service_sendmail_enable }}"