Starting an rc file to set up netgraph.

This commit is contained in:
Tom Alexander
2022-10-29 17:45:06 -04:00
parent c6ed886f4c
commit 4e29c2e3d8
4 changed files with 100 additions and 0 deletions

View File

@@ -90,3 +90,38 @@
state: absent
when: jail_list|community.general.json_query('[?enabled==`true`]')|length == 0
- name: Install rc script
when: netgraph_config is defined
copy:
src: "files/{{ item.src }}"
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
owner: root
group: wheel
mode: 0755
loop:
- src: setup_netgraph
- name: Install scripts
when: netgraph_config is defined
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: "{{ netgraph_config }}"
dest: /usr/local/bin/setup_netgraph
- name: Enable setup_netgraph
when: netgraph_config is defined
community.general.sysrc:
name: setup_netgraph_enable
value: "YES"
path: /etc/rc.conf.d/setup_netgraph
- name: Disable setup_netgraph
when: netgraph_config is not defined
file:
path: /etc/rc.conf.d/setup_netgraph
state: absent