2017-08-07 12:09:13 +02:00
|
|
|
---
|
|
|
|
# tasks file for nftables
|
|
|
|
|
|
|
|
- name: Load specific OS vars for nft
|
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
|
|
|
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml"
|
|
|
|
- "{{ ansible_distribution|lower }}.yml"
|
|
|
|
- "{{ ansible_os_family|lower }}.yml"
|
|
|
|
|
2017-08-07 13:48:54 +02:00
|
|
|
# package {{{
|
2017-08-07 12:09:13 +02:00
|
|
|
- name: Manage packages
|
|
|
|
package:
|
|
|
|
name: '{{ item }}'
|
|
|
|
state: '{{ nft_pkg_state }}'
|
|
|
|
with_items:
|
|
|
|
- '{{ nft_pkg_list }}'
|
|
|
|
when: nft_pkg_manage
|
|
|
|
|
2017-08-07 13:48:54 +02:00
|
|
|
# }}}
|
|
|
|
|
|
|
|
# conf {{{
|
|
|
|
- name: generate main conf file
|
|
|
|
template:
|
|
|
|
src: "{{ nft_main_conf_content }}"
|
|
|
|
dest: "{{ nft_main_conf_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
backup: yes
|
2017-08-07 14:14:14 +02:00
|
|
|
notify: restart nftables service
|
2017-08-07 17:37:41 +02:00
|
|
|
|
|
|
|
- name: generate input rules file
|
|
|
|
template:
|
|
|
|
src: "{{ nft_input_conf_content }}"
|
|
|
|
dest: "{{ nft_input_conf_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
backup: yes
|
|
|
|
notify: restart nftables service
|
2017-08-08 12:11:58 +02:00
|
|
|
|
|
|
|
- name: generate vars definition file
|
|
|
|
template:
|
|
|
|
src: "{{ nft_define_conf_content }}"
|
|
|
|
dest: "{{ nft_define_conf_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
backup: yes
|
|
|
|
notify: restart nftables service
|
2017-08-08 14:32:59 +02:00
|
|
|
|
|
|
|
- name: generate sets and maps file
|
|
|
|
template:
|
|
|
|
src: "{{ nft_set_conf_content }}"
|
|
|
|
dest: "{{ nft_set_conf_path }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
backup: yes
|
|
|
|
notify: restart nftables service
|
2017-08-07 13:48:54 +02:00
|
|
|
# }}}
|