2016-01-08 23:36:31 +08:00
|
|
|
---
|
|
|
|
- name: check if nmap is installed
|
2016-01-10 23:52:37 +08:00
|
|
|
command: "command -v nmap"
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: nmapexist
|
2016-02-24 00:27:55 +08:00
|
|
|
when: check_firewall
|
2016-01-08 23:36:31 +08:00
|
|
|
|
2016-01-11 00:22:17 +08:00
|
|
|
- name: inform that nmap is not present
|
|
|
|
debug:
|
|
|
|
msg: "nmap is not installed, can not test if ceph ports are allowed :("
|
2016-02-24 00:27:55 +08:00
|
|
|
when:
|
|
|
|
check_firewall and
|
|
|
|
nmapexist.rc != 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if monitor port is not filtered
|
2016-02-24 00:27:55 +08:00
|
|
|
local_action: shell set -o pipefail && nmap -p 6789 {{ item }} {{ hostvars[item]['ansible_' + monitor_interface]['ipv4']['address'] }} | grep -sqo filtered
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
with_items: groups.{{ mon_group_name }}
|
|
|
|
register: monportstate
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-11 00:22:17 +08:00
|
|
|
mon_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: fail if monitor port is filtered
|
|
|
|
fail:
|
|
|
|
msg: "Please allow port 6789 on your firewall"
|
|
|
|
with_items: monportstate.results
|
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-08 23:36:31 +08:00
|
|
|
item.rc == 0 and
|
|
|
|
mon_group_name is defined and
|
2016-01-11 00:22:17 +08:00
|
|
|
mon_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if osd and mds range is not filtered
|
2016-02-24 00:27:55 +08:00
|
|
|
local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
with_items: groups.{{ osd_group_name }}
|
|
|
|
register: osdrangestate
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-11 00:22:17 +08:00
|
|
|
osd_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: fail if osd and mds range is filtered (osd hosts)
|
|
|
|
fail:
|
|
|
|
msg: "Please allow range from 6800 to 7300 on your firewall"
|
|
|
|
with_items: osdrangestate.results
|
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-08 23:36:31 +08:00
|
|
|
item.rc == 0 and
|
|
|
|
osd_group_name is defined and
|
2016-01-11 00:22:17 +08:00
|
|
|
osd_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if osd and mds range is not filtered
|
2016-02-24 00:27:55 +08:00
|
|
|
local_action: shell set -o pipefail && nmap -p 6800-7300 {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
with_items: groups.{{ mds_group_name }}
|
|
|
|
register: mdsrangestate
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-11 00:22:17 +08:00
|
|
|
mds_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: fail if osd and mds range is filtered (mds hosts)
|
|
|
|
fail:
|
|
|
|
msg: "Please allow range from 6800 to 7300 on your firewall"
|
|
|
|
with_items: mdsrangestate.results
|
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-08 23:36:31 +08:00
|
|
|
item.rc == 0 and
|
|
|
|
mds_group_name is defined and
|
2016-01-11 00:22:17 +08:00
|
|
|
mds_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if rados gateway port is not filtered
|
2016-02-24 00:27:55 +08:00
|
|
|
local_action: shell set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ item }} {{ hostvars[item]['ansible_default_ipv4']['address'] }} | grep -sqo filtered
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
with_items: groups.rgws
|
|
|
|
register: rgwportstate
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-11 00:22:17 +08:00
|
|
|
rgw_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: fail if rados gateway port is filtered
|
|
|
|
fail:
|
|
|
|
msg: "Please allow port {{ radosgw_civetweb_port }} on your firewall"
|
|
|
|
with_items: rgwportstate.results
|
|
|
|
when:
|
2016-02-24 00:27:55 +08:00
|
|
|
check_firewall and
|
2016-01-08 23:36:31 +08:00
|
|
|
item.rc == 0 and
|
|
|
|
rgw_group_name is defined and
|
2016-01-11 00:22:17 +08:00
|
|
|
rgw_group_name in group_names and
|
|
|
|
nmapexist.rc == 0
|