diff --git a/defaults/main.yml b/defaults/main.yml index 5eac29f..523822b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: | diff --git a/tasks/ceph_auth.yml b/tasks/ceph_auth.yml index 086b1b6..9e34d66 100644 --- a/tasks/ceph_auth.yml +++ b/tasks/ceph_auth.yml @@ -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 diff --git a/tasks/ceph_config.yml b/tasks/ceph_config.yml index 06e46b1..2b25c5c 100644 --- a/tasks/ceph_config.yml +++ b/tasks/ceph_config.yml @@ -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 diff --git a/tasks/ceph_get_mon_host.yml b/tasks/ceph_get_mon_host.yml index b24b1ff..641c808 100644 --- a/tasks/ceph_get_mon_host.yml +++ b/tasks/ceph_get_mon_host.yml @@ -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 }}"