2016-01-08 23:36:31 +08:00
|
|
|
---
|
|
|
|
- name: check if nmap is installed
|
2016-12-28 16:21:23 +08:00
|
|
|
local_action: shell command -v nmap
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: nmapexist
|
2016-06-07 19:48:07 +08:00
|
|
|
run_once: true
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
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-06-07 19:48:07 +08:00
|
|
|
run_once: true
|
2016-02-24 00:27:55 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- nmapexist.rc != 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if monitor port is not filtered
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: shell
|
|
|
|
set -o pipefail && nmap -p 6789 {{ hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4']['address'] if hostvars[inventory_hostname]['ansible_' + monitor_interface] is defined else hostvars[inventory_hostname]['monitor_address'] }} | grep -sqo -e filtered -e '0 hosts up'
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: monportstate
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- mon_group_name in group_names
|
|
|
|
- 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"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- mon_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
2016-06-22 22:10:16 +08:00
|
|
|
- monportstate.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
2016-06-04 15:03:22 +08:00
|
|
|
- name: check if osd and mds range is not filtered (osd hosts)
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: shell
|
|
|
|
set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up'
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: osdrangestate
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- osd_group_name in group_names
|
|
|
|
- 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"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- osd_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
2016-06-22 22:10:16 +08:00
|
|
|
- osdrangestate.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
2016-06-04 15:03:22 +08:00
|
|
|
- name: check if osd and mds range is not filtered (mds hosts)
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: shell
|
|
|
|
set -o pipefail && nmap -p 6800-7300 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up'
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: mdsrangestate
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- mds_group_name in group_names
|
|
|
|
- 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"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- mds_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
2016-06-22 22:10:16 +08:00
|
|
|
- mdsrangestate.rc == 0
|
2016-01-08 23:36:31 +08:00
|
|
|
|
|
|
|
- name: check if rados gateway port is not filtered
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: shell
|
|
|
|
set -o pipefail && nmap -p {{ radosgw_civetweb_port }} {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up'
|
2016-01-08 23:36:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: rgwportstate
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-01-11 00:22:17 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- rgw_group_name in group_names
|
|
|
|
- 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"
|
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- rgw_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
2016-06-22 22:10:16 +08:00
|
|
|
- rgwportstate.rc == 0
|
2016-05-06 02:20:03 +08:00
|
|
|
|
|
|
|
- name: check if NFS ports are not filtered
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: shell
|
|
|
|
set -o pipefail && nmap -p 111,2049 {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} | grep -sqo -e filtered -e '0 hosts up'
|
2016-05-06 02:20:03 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: nfsportstate
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-05-06 02:20:03 +08:00
|
|
|
when:
|
|
|
|
- nfs_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
|
|
|
|
|
|
|
- name: fail if NFS ports are filtered
|
|
|
|
fail:
|
|
|
|
msg: "Please allow ports 111 and 2049 on your firewall"
|
|
|
|
when:
|
|
|
|
- nfs_group_name in group_names
|
|
|
|
- nmapexist.rc == 0
|
2016-06-22 22:10:16 +08:00
|
|
|
- nfsportstate.rc == 0
|