community.general.sysrc – Manage FreeBSD using sysrc
Note
This plugin is part of the community.general collection (version 3.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.sysrc
.
New in version 2.0.0: of community.general
Parameters
Parameter |
Comments |
---|---|
Delimiter to be used instead of Only used when state=value_present or state=value_absent. Default: ” “ |
|
Name or ID of the jail to operate on. |
|
Name of variable in |
|
Path to file to use instead of Default: “/etc/rc.conf” |
|
Use present to add the variable. Use absent to remove the variable. Use value_present to add the value to the existing variable. Use value_absent to remove the value from the existing variable. Choices:
|
|
The value to set when state=present. The value to add when state=value_present. The value to remove when state=value_absent. |
Examples
---
# enable mysql in the /etc/rc.conf
- name: Configure mysql pid file
community.general.sysrc:
name: mysql_pidfile
value: "/var/run/mysqld/mysqld.pid"
# enable accf_http kld in the boot loader
- name: Enable accf_http kld
community.general.sysrc:
name: accf_http_load
state: present
value: "YES"
path: /boot/loader.conf
# add gif0 to cloned_interfaces
- name: Add gif0 interface
community.general.sysrc:
name: cloned_interfaces
state: value_present
value: "gif0"
# enable nginx on a jail
- name: Enable nginx in test jail
community.general.sysrc:
name: nginx_enable
value: "YES"
jail: testjail
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Return changed for sysrc actions. Returned: always Sample: true |
Authors
David Lundgren (@dlundgren)