Skip to content

Commit 04f0b36

Browse files
committed
Specify port in known_hosts when adding cluster nodes.
Fixes #221
1 parent 569a203 commit 04f0b36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/pve_add_node.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- name: Identify the SSH public key and SSH addresses of initial cluster host
44
ansible.builtin.set_fact:
55
_pve_cluster_host_key: "{{ ' '.join((hostvars[_init_node]._pve_ssh_public_key.content | b64decode).split()[:-1]) }}"
6-
_pve_cluster_host_addresses: "{{ hostvars[_init_node].pve_cluster_ssh_addrs | join(',') }}"
6+
_pve_cluster_host_addresses: "{{ hostvars[_init_node].pve_cluster_ssh_addrs | map('regex_replace', '^(.*)$', (pve_ssh_port == 22) | ternary('\\1', '[\\1]:' + (pve_ssh_port | string))) | join(',') }}"
77

88
- name: Temporarily mark that cluster host as known in root user's known_hosts
99
ansible.builtin.blockinfile:

0 commit comments

Comments
 (0)