2015-11-18 23:02:49 +00:00
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: manage firewalld service
|
|
|
|
service:
|
2017-12-21 03:47:20 +00:00
|
|
|
name: firewalld
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-18 23:02:49 +00:00
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: enable https in firewalld
|
|
|
|
firewalld:
|
2017-12-21 03:47:20 +00:00
|
|
|
service: https
|
|
|
|
permanent: true
|
|
|
|
state: enabled
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-18 23:02:49 +00:00
|
|
|
notify: restart firewalld
|
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: enable http in firewalld
|
|
|
|
firewalld:
|
2017-12-21 03:47:20 +00:00
|
|
|
service: http
|
|
|
|
permanent: true
|
|
|
|
state: enabled
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-18 23:02:49 +00:00
|
|
|
notify: restart firewalld
|
2015-11-30 15:08:24 +00:00
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: enable ssh rule in firewalld
|
|
|
|
firewalld:
|
2017-12-21 03:47:20 +00:00
|
|
|
rich_rule: 'rule service name="ssh" family="ipv4" source address="{{ item }}" accept'
|
|
|
|
permanent: true
|
|
|
|
state: enabled
|
2021-01-29 20:03:40 +00:00
|
|
|
with_items: "{{ firewall_addrs }}"
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-30 15:08:24 +00:00
|
|
|
notify: restart firewalld
|
2015-12-27 21:20:23 +00:00
|
|
|
when: is_production_vm == True
|
2015-11-30 15:08:24 +00:00
|
|
|
|
2018-03-20 17:04:30 +00:00
|
|
|
- name: disable ssh service in firewalld
|
|
|
|
firewalld:
|
2017-12-21 03:47:20 +00:00
|
|
|
service: ssh
|
|
|
|
permanent: true
|
|
|
|
state: disabled
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2015-11-30 15:08:24 +00:00
|
|
|
notify: restart firewalld
|
2015-12-27 21:20:23 +00:00
|
|
|
when: is_production_vm == True
|
2015-11-30 15:08:24 +00:00
|
|
|
|
2016-04-26 15:20:52 +00:00
|
|
|
- name: define new icmp types for timestamp responses
|
2017-12-21 03:47:20 +00:00
|
|
|
copy:
|
|
|
|
dest: '/etc/firewalld/icmptypes/{{ item }}.xml'
|
|
|
|
src: '{{ item }}.xml'
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2016-04-26 15:20:52 +00:00
|
|
|
with_items:
|
|
|
|
- timestamp-reply
|
|
|
|
- timestamp-request
|
|
|
|
|
|
|
|
- name: load new icmp types for timestamp responses
|
|
|
|
command: firewall-cmd --reload
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2016-04-26 15:20:52 +00:00
|
|
|
|
|
|
|
- name: disable icmp timestamp responses
|
|
|
|
command: firewall-cmd --permanent --zone=public --add-icmp-block={{ item }}
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|
2016-04-26 15:20:52 +00:00
|
|
|
with_items:
|
|
|
|
- timestamp-reply
|
|
|
|
- timestamp-request
|
|
|
|
notify: restart firewalld
|
|
|
|
|
2015-11-30 15:08:24 +00:00
|
|
|
- name: restart firewalld
|
2017-12-21 03:47:20 +00:00
|
|
|
service:
|
|
|
|
name: firewalld
|
|
|
|
state: restarted
|
2016-07-14 03:15:07 +00:00
|
|
|
become: yes
|