This commit is contained in:
2026-06-15 13:09:24 +03:00
parent b9e073c139
commit b517921483

View File

@@ -1706,7 +1706,7 @@
delegate_to: localhost delegate_to: localhost
shell: | shell: |
PORT="{{ _local_port }}" PORT="{{ _local_port }}"
sshpass -f "{{ dev2_passfile_used }}" ssh {{ ssh_opts_common }} -o ConnectTimeout={{ ssh_timeout }} -p "$PORT" "{{ dev2_ssh_user }}@127.0.0.1" "f=$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=${f##*/prepared_backup_}; v=${f%-r*}; r=${f##*-r}; [ -n "$v" ] && [ -n "$r" ] && echo "$v rev $r" || true" sshpass -f "{{ dev2_passfile_used }}" ssh {{ ssh_opts_common }} -o ConnectTimeout={{ ssh_timeout }} -p "$PORT" "{{ dev2_ssh_user }}@127.0.0.1" 'f=$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=${f##*/}; ver=$(printf "%s\n" "$f" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+-r[0-9]+" | head -n1); [ -n "$ver" ] && echo "${ver/-r/ rev }" || true'
args: args:
executable: /bin/bash executable: /bin/bash
register: dev2_fwver_backup_marker_tunnel register: dev2_fwver_backup_marker_tunnel
@@ -1723,7 +1723,7 @@
- dev2_passfile_used_lldp != 'NONE' - dev2_passfile_used_lldp != 'NONE'
delegate_to: localhost delegate_to: localhost
shell: | shell: |
sshpass -f "{{ dev2_passfile_used_lldp }}" ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o ConnectTimeout=15 "{{ dev2_ssh_user }}@{{ lldp_dev2_ip }}" "f=$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=${f##*/prepared_backup_}; v=${f%-r*}; r=${f##*-r}; [ -n "$v" ] && [ -n "$r" ] && echo "$v rev $r" || true" sshpass -f "{{ dev2_passfile_used_lldp }}" ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o ConnectTimeout=15 "{{ dev2_ssh_user }}@{{ lldp_dev2_ip }}" 'f=$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=${f##*/}; ver=$(printf "%s\n" "$f" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+-r[0-9]+" | head -n1); [ -n "$ver" ] && echo "${ver/-r/ rev }" || true'
args: args:
executable: /bin/bash executable: /bin/bash
register: dev2_fwver_backup_marker_lldp register: dev2_fwver_backup_marker_lldp
@@ -1748,7 +1748,7 @@
exit 0 exit 0
fi fi
sshpass -p '{{ dev1_pass }}' ssh {{ ssh_opts_common }} "{{ dev1_user }}@{{ ansible_host|default(inventory_hostname) }}" "sshpass -f '/tmp/${F}' ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o ConnectTimeout={{ ssh_timeout }} '{{ dev2_ssh_user }}@\[${IP6}%{{ dev1_iface }}\]' 'f=\$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=\${f##*/prepared_backup_}; v=\${f%-r*}; r=\${f##*-r}; [ -n "\$v" ] && [ -n "\$r" ] && echo "\$v rev \$r" || true'" sshpass -p '{{ dev1_pass }}' ssh {{ ssh_opts_common }} "{{ dev1_user }}@{{ ansible_host|default(inventory_hostname) }}" "sshpass -f '/tmp/${F}' ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o ConnectTimeout={{ ssh_timeout }} '{{ dev2_ssh_user }}@\[${IP6}%{{ dev1_iface }}\]' 'f=\$(ls -1 /root/prepared_backup_* 2>/dev/null | head -n1); f=\${f##*/}; ver=\$(printf \"%s\n\" \"\$f\" | grep -Eo \"[0-9]+\.[0-9]+\.[0-9]+-r[0-9]+\" | head -n1); [ -n \"\$ver\" ] && echo \"\${ver/-r/ rev }\" || true'"
args: args:
executable: /bin/bash executable: /bin/bash
register: dev2_fwver_backup_marker_lldp6 register: dev2_fwver_backup_marker_lldp6