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?
Placed patch to cover this bug https:/ /review. opendev. org/c/openstack /openstack- ansible- os_swift/ +/765354