ansible-playbooks/ubuntu/roles/ipset-deploy/tasks/main.yml

29 lines
506 B
YAML
Raw Normal View History

2020-04-15 01:42:03 +00:00
---
# This role deploys ipset rulesets to Ubuntu hosts
2020-04-15 01:47:08 +00:00
- name: Flush any existing ipsets
shell:
cmd: /sbin/ipset destroy
2020-04-15 01:42:03 +00:00
- name: Copy ipset.service
copy:
src: ipset.service
dest: /etc/systemd/system/ipset.service
notify:
- reload systemd
- name: Enable ipset.service
systemd:
name: ipset
enabled: yes
- name: Copy ipset rulesets
copy:
src: "{{ ansible_fqdn }}.ipset"
2020-04-15 01:42:03 +00:00
dest: /etc/ipset.conf
2020-04-15 01:56:08 +00:00
- name: Restart ipset
systemd:
name: ipset
state: restarted