-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebserver-absent.yaml
38 lines (35 loc) · 981 Bytes
/
webserver-absent.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- name: Remove all webserver configs
hosts: all
become: true
gather_facts: true
tasks:
- name: Remove Apache for RHEL/CentOS
ansible.builtin.yum:
name: httpd
state: absent
autoremove: yes
when:
- ansible_facts['os_family'] == "RedHat"
- name: Remove Apache for Ubuntu
ansible.builtin.apt:
name: apache2
state: absent
autoremove: yes
when:
- ansible_facts['os_family'] == "Debian"
- name: block traffic in default zone for http service
ansible.posix.firewalld:
service: http
permanent: true
immediate: true
state: disabled
when:
- ansible_facts['os_family'] == "RedHat"
- name: block traffic in default zone for https service
ansible.posix.firewalld:
service: https
permanent: true
immediate: true
state: disabled
when:
- ansible_facts['os_family'] == "RedHat"