community / community.general / 2.5.9 / module / sysrc Manage FreeBSD using sysrc | "added in version" 2.0.0 of community.general" Authors: David Lundgren (@dlundgren)community.general.sysrc (2.5.9) — module
Install with ansible-galaxy collection install community.general:==2.5.9
collections: - name: community.general version: 2.5.9
Manages C(/etc/rc.conf) for FreeBSD.
--- # 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
jail: description: - Name or ID of the jail to operate on. type: str name: description: - Name of variable in C(/etc/rc.conf) to manage. required: true type: str path: default: /etc/rc.conf description: - Path to file to use instead of C(/etc/rc.conf). type: str delim: default: ' ' description: - Delimiter to be used instead of C( ). - Only used when I(state=value_present) or I(state=value_absent). type: str state: choices: - absent - present - value_present - value_absent default: present description: - Use I(present) to add the variable. - Use I(absent) to remove the variable. - Use I(value_present) to add the value to the existing variable. - Use I(value_absent) to remove the value from the existing variable. type: str value: description: - The value to set when I(state=present). - The value to add when I(state=value_present). - The value to remove when I(state=value_absent). type: str
changed: description: Return changed for sysrc actions. returned: always sample: true type: bool