sysrc
Create or configure rc.conf file and rc.conf.d directory.
Parameters
Parameter |
Type |
Comments |
|
|---|---|---|---|
path |
string |
Path to file. |
|
jail |
string |
Jail name/ID to operate on. |
|
delim |
string |
Delimiter instead of space. |
|
sysrc |
list |
||
key |
string |
Parameter name. |
|
value |
string |
Parameter value. |
|
state |
string |
see community.general.sysrc |
|
handlers |
list |
List of handlers. |
|
Example
Configure git_daemon
conf-light/files.d/git.yml
git:
path: /etc/rc.conf
sysrc: "{{ cl_git_daemon_dict }}"
handlers:
- restart git_daemon
host_vars/branch-server.example.com/cl-git-daemon.yml
cl_git_daemon_user: git_daemon
cl_git_daemon_group: git_daemon
cl_git_daemon_directory: /usr/local/var/db/git
cl_git_daemon_flags: "--syslog --reuseaddr --detach --base-path={{ cl_git_daemon_directory }}"
cl_git_daemon_dict: "{{ cl_git_daemon_dict_raw | dict2items }}"
cl_git_daemon_dict_raw:
git_daemon_user: "{{ cl_git_daemon_user }}"
git_daemon_group: "{{ cl_git_daemon_group }}"
git_daemon_directory: "{{ cl_git_daemon_directory }}"
git_daemon_flags: "{{ cl_git_daemon_flags }}"
creates the below lines in /etc/rc.conf
/etc/rc.onf
git_daemon_user=git_daemon
git_daemon_group=git_daemon
git_daemon_directory=/usr/local/var/db/git
git_daemon_flags="--syslog --reuseaddr --detach --base-path=/usr/local/var/db/git"
See also
See files-sysrc.yml annotated source code
Ansible module community.general.sysrc