aboutsummaryrefslogblamecommitdiffstats
path: root/roles/space_server/tasks/nftables.yml
blob: 2dc8fcea5f0e57bcb387a1ea1b2be2dc4d38cbe4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                







                                        


                               
                              
















                                                                           
---
- name: Install our nftables service
  copy:
    src: nftables/nftables.service
    dest: '/etc/systemd/system/nftables.service'

- name: Install nftables package
  dnf:
    name: nftables
    state: latest
  tags:
    - packages

- name: Symlink to /etc/nftables.conf
  file:
    path: '/etc/sysconfig/nftables.conf'
    state: link
    src: '../nftables.conf'
    force: yes
  notify:
    - reload nftables
- name: Configure nftables
  copy:
    src: nftables/nftables.conf
    dest: '/etc/nftables.conf'
  notify:
    - reload nftables

- name: Enable nftables service
  systemd:
    name: nftables.service
    enabled: yes
    masked: no
    state: started
  when: "'container' not in ansible_env"
- name: '- when in nspawn'
  command: systemctl enable nftables.service
  args:
    creates: '/etc/systemd/system/multi-user.target.wants/nftables.service'
  when: "'container' in ansible_env"

# vim: set ts=2 sw=2 et: