community.general.sysrc module – Manage FreeBSD using sysrc
Note
This module is part of the community.general collection (version 8.6.8).
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 community.general 2.0.0
Synopsis
Manages
/etc/rc.conf
for FreeBSD.
Aliases: system.sysrc
Parameters
Parameter |
Comments |
---|---|
Delimiter to be used instead of Only used when Default: |
|
Name or ID of the jail to operate on. |
|
Name of variable in |
|
Path to file to use instead of Default: |
|
Use Use Use Use Choices:
|
|
The value to set when The value to add when The value to remove when |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
The
name
cannot contain periods as sysrc does not support OID style names.
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: |