2020-04-15 01:42:03 +00:00
|
|
|
---
|
|
|
|
# This role deploys ipset rulesets to Ubuntu hosts
|
|
|
|
|
2020-04-15 02:15:06 +00:00
|
|
|
- name: Destroy any existing ipsets
|
2020-04-15 01:47:08 +00:00
|
|
|
shell:
|
2020-04-15 02:15:06 +00:00
|
|
|
cmd: /sbin/ipset destroy
|
2020-04-15 01:47:08 +00:00
|
|
|
|
2020-04-15 01:42:03 +00:00
|
|
|
- name: Copy ipset.service
|
|
|
|
copy:
|
|
|
|
src: ipset.service
|
|
|
|
dest: /etc/systemd/system/ipset.service
|
|
|
|
|
|
|
|
- name: Enable ipset.service
|
|
|
|
systemd:
|
|
|
|
name: ipset
|
|
|
|
enabled: yes
|
2020-04-15 02:09:41 +00:00
|
|
|
daemon_reload: yes
|
2020-04-15 01:42:03 +00:00
|
|
|
|
|
|
|
- name: Copy ipset rulesets
|
|
|
|
copy:
|
2020-04-15 01:44:46 +00:00
|
|
|
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
|