You've already forked role_nftables
feat: Create role
This commit is contained in:
20
tasks/configuration.yml
Normal file
20
tasks/configuration.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
# tasks file for nftables
|
||||
|
||||
- name: Build rules list
|
||||
ansible.builtin.set_fact:
|
||||
nftables_rules: "{{ nftables_rules + specific }}"
|
||||
when: specific | length > 0
|
||||
loop: "{{ lookup('ansible.builtin.varnames', '^nftables_rules_.+', wantlist=True) }}"
|
||||
vars:
|
||||
specific: "{{ lookup('ansible.builtin.vars', item, default='') }}"
|
||||
|
||||
- name: Deploy configuration file
|
||||
ansible.builtin.template:
|
||||
src: "{{ nftables_conf_template }}"
|
||||
dest: "{{ nftables_conf_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rw,g=,o=
|
||||
become: true
|
||||
notify: Restart nftables.service
|
||||
Reference in New Issue
Block a user