Get swift rings ssh conection

Bug #1904935 reported by Roman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Dmitriy Rabotyagov

Bug Description

My host compute04 works on the SSH port 2022. For a number of reasons, I can not change it.

My configuration
# swift hosts
swift_hosts:
  compute04:
    ip: 172.29.236.234
    host_vars:
      ansible_port: 2022
    container_vars:
       swift_vars:
         storage_ip: 172.29.244.234
         groups:
           - account
           - container
           - gold

I got an error while trying to install the swift

TASK [os_swift : Get swift rings] ******************************************************************************************************************
fatal: [compute04]: FAILED! => {"changed": false, "cmd": ["rsync", "-e", "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no", "-avz", "swift@172.29.236.234:/etc/swift/ring_build_files/", "/etc/swift/"], "delta": "0:00:00.011924", "end": "2020-11-19 20:15:58.989244", "msg": "non-zero return code", "rc": 255, "start": "2020-11-19 20:15:58.977320", "stderr": "ssh: connect to host 172.29.236.234 port 22: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]", "stderr_lines": ["ssh: connect to host 172.29.236.234 port 22: Connection refused", "rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]", "rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]"], "stdout": "", "stdout_lines": []}
fatal: [controller01_swift_proxy_container-8484f115]: FAILED! => {"changed": false, "cmd": ["rsync", "-e", "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no", "-avz", "swift@172.29.236.234:/etc/swift/ring_build_files/", "/etc/swift/"], "delta": "0:00:00.008768", "end": "2020-11-19 20:15:59.202178", "msg": "non-zero return code", "rc": 255, "start": "2020-11-19 20:15:59.193410", "stderr": "ssh: connect to host 172.29.236.234 port 22: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]", "stderr_lines": ["ssh: connect to host 172.29.236.234 port 22: Connection refused", "rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]", "rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]"], "stdout": "", "stdout_lines": []}
fatal: [controller02_swift_proxy_container-8184b9f1]: FAILED! => {"changed": false, "cmd": ["rsync", "-e", "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no", "-avz", "swift@172.29.236.234:/etc/swift/ring_build_files/", "/etc/swift/"], "delta": "0:00:00.010265", "end": "2020-11-19 20:15:59.419067", "msg": "non-zero return code", "rc": 255, "start": "2020-11-19 20:15:59.408802", "stderr": "ssh: connect to host 172.29.236.234 port 22: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]", "stderr_lines": ["ssh: connect to host 172.29.236.234 port 22: Connection refused", "rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]", "rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]"], "stdout": "", "stdout_lines": []}
fatal: [controller03_swift_proxy_container-1ce16d90]: FAILED! => {"changed": false, "cmd": ["rsync", "-e", "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no", "-avz", "swift@172.29.236.234:/etc/swift/ring_build_files/", "/etc/swift/"], "delta": "0:00:00.014460", "end": "2020-11-19 20:15:59.645353", "msg": "non-zero return code", "rc": 255, "start": "2020-11-19 20:15:59.630893", "stderr": "ssh: connect to host 172.29.236.234 port 22: Connection refused\r\nrsync: connection unexpectedly closed (0 bytes received so far) [Receiver]\nrsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]", "stderr_lines": ["ssh: connect to host 172.29.236.234 port 22: Connection refused", "rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]", "rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.2]"], "stdout": "", "stdout_lines": []}

After I changed swift_rings_post_distribution_check.yml I was able to complete the installation

Before:
- name: "Get swift rings"
  command: >
    rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
          -avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
          /etc/swift/
  args:
    warn: no
  become: yes
  become_user: "{{ swift_system_user_name }}"
  changed_when: false
  tags:
    - skip_ansible_lint

- name: "Get swift rings for backup in ring_build_files directory"
  command: >
    rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
          -avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
          /etc/swift/ring_build_files/
  args:
    warn: no
  become: yes
  become_user: "{{ swift_system_user_name }}"
  changed_when: false
  tags:
    - skip_ansible_lint

After:
- name: "Get swift rings"
  command: >
    rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p {{ hostvars[groups['swift_hosts'][0]]['ansible_port'] | default(22) }}'
          -avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
          /etc/swift/
  args:
    warn: no
  become: yes
  become_user: "{{ swift_system_user_name }}"
  changed_when: false
  tags:
    - skip_ansible_lint

- name: "Get swift rings for backup in ring_build_files directory"
  command: >
    rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p {{ hostvars[groups['swift_hosts'][0]]['ansible_port'] | default(22) }}'
          -avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
          /etc/swift/ring_build_files/
  args:
    warn: no
  become: yes
  become_user: "{{ swift_system_user_name }}"
  changed_when: false
  tags:
    - skip_ansible_lint

Is there a correct way to deploy swift if I use a non-standard SSH port?

Changed in openstack-ansible:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Dmitriy Rabotyagov (noonedeadpunk)
Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :
Changed in openstack-ansible:
status: Triaged → In Progress
Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_swift yoga-eom

This issue was fixed in the openstack/openstack-ansible-os_swift yoga-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_swift victoria-eom

This issue was fixed in the openstack/openstack-ansible-os_swift victoria-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_swift wallaby-eom

This issue was fixed in the openstack/openstack-ansible-os_swift wallaby-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible-os_swift xena-eom

This issue was fixed in the openstack/openstack-ansible-os_swift xena-eom release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.