Added possibility to specify ssh username and port for ceph mons.

Now SSH port relies on ansible_port variable. On case of using
non-standard SSH ports on all infrastructure, only this role fails on
connection to CEPH monitors.
Added ceph_mon_user variable to defaults. This may be usefull, as ceph
recommends to do all actions with non-root users, so ability to override
user is pretty usefull.


Change-Id: I01f42287f50dbeb2c6a7f8912e08d21aca2d24b9
Related-Bug: 1773925
This commit is contained in:
Dmitriy R 2018-07-19 15:04:30 +03:00 committed by Dmitriy Rabotjagov (noonedeadpunk)
parent 5873b7f422
commit 58ac4da336
4 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,9 @@ cephx: true
# A list of the IP addresses for your Ceph monitors
ceph_mons: []
# User, wich is used for establishing SSH connection to ceph_mons
ceph_mon_user: "{{ ansible_user }}"
# Path to local ceph.conf file
# Leave this commented to obtain a ceph.conf from one of the monitors defined in ceph_mons
#ceph_conf_file: |

View File

@ -25,6 +25,7 @@
changed_when: false
delegate_to: '{{ ceph_mon_host }}'
register: ceph_client_keyrings
remote_user: '{{ ceph_mon_user }}'
until: ceph_client_keyrings is success
retries: 3
tags:
@ -79,6 +80,7 @@
- inventory_hostname in groups.nova_compute
changed_when: false
delegate_to: '{{ ceph_mon_host }}'
remote_user: '{{ ceph_mon_user }}'
register: ceph_nova_secret
tags:
- always

View File

@ -26,6 +26,7 @@
src: /etc/ceph/ceph.conf
register: ceph_conf_content_mon
delegate_to: '{{ ceph_mon_host }}'
remote_user: '{{ ceph_mon_user }}'
changed_when: false
when:
- ceph_conf_file is not defined

View File

@ -20,6 +20,8 @@
-o ConnectTimeout=6
-o UserKnownHostsFile=/dev/null
-o StrictHostKeyChecking=no
-l "{{ ceph_mon_user }}"
-p "{{ ansible_port }}"
{{ item }}
exit
with_items: "{{ ceph_mons }}"