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