This commit is contained in:
2025-11-17 17:13:43 +02:00
parent 48333ce7ec
commit e19d4210d3
2 changed files with 17 additions and 17 deletions

View File

@@ -1031,21 +1031,28 @@
ansible.builtin.raw: arping -U -I eth0 192.168.1.11 -c 3
- name: Copy bootenv image to DEV2 if missing or sha256 mismatch
when: local_img.stat.exists and dev2_passfile_used != "NONE" and not (_blocked | default(false)) and ((dev2_sha256_before.stdout | trim) != (bootenv_sha256 | trim))
when: local_img.stat.exists
and dev2_passfile_used != "NONE"
and not (_blocked | default(false))
and ((dev2_sha256_before.stdout | trim) != (bootenv_sha256 | trim))
delegate_to: localhost
ansible.builtin.shell: |
set -e
HOST="{{ dev2_ssh_host }}"
PORT="{{ dev2_ssh_port }}"
sshpass -f "{{ dev2_passfile_used }}" scp \
-P "$PORT" \
sshpass -f "{{ dev2_passfile_used }}" ssh \
-o AddressFamily=inet \
-o StrictHostKeyChecking=no -o PubkeyAuthentication=no \
"{{ bootenv_filename }}" "{{ dev2_ssh_user }}@${HOST}:{{ dev2_ssh_user == 'root' | ternary('/', '') }}{{ dev2_image_dir }}/"
-o PreferredAuthentications=password -o NumberOfPasswordPrompts=1 \
-o ConnectTimeout=30 \
-p "$PORT" "{{ dev2_ssh_user }}@${HOST}" \
"wget -O '{{ dev2_image_path }}' 'https://cloud.ikeja.co.za/firmwares/uboot/{{ bootenv_filename }}'"
args:
executable: /bin/bash
register: scp_bootenv
changed_when: true
- name: Compute sha256 of bootenv image on DEV2 after copy (or if already present)
when: local_img.stat.exists and dev2_passfile_used != "NONE" and not (_blocked | default(false))
delegate_to: localhost

View File

@@ -1157,29 +1157,22 @@
register: dev2_md5_before
changed_when: false
- name: Copy bootenv image to DEV2 if missing or sha256 mismatch
when: local_img.stat.exists
and dev2_passfile_used != "NONE"
and not (_blocked | default(false))
and ((dev2_sha256_before.stdout | trim) != (bootenv_sha256 | trim))
- name: Copy image to DEV2 if missing or md5 mismatch
when: local_img.stat.exists and dev2_passfile_used != "NONE" and not (_blocked | default(false)) and ((dev2_md5_before.stdout | trim) != image_md5)
delegate_to: localhost
ansible.builtin.shell: |
set -e
HOST="{{ dev2_ssh_host }}"
PORT="{{ dev2_ssh_port }}"
sshpass -f "{{ dev2_passfile_used }}" ssh \
-o AddressFamily=inet \
sshpass -f "{{ dev2_passfile_used }}" scp \
-P "$PORT" \
-o StrictHostKeyChecking=no -o PubkeyAuthentication=no \
-o PreferredAuthentications=password -o NumberOfPasswordPrompts=1 \
-o ConnectTimeout=30 \
-p "$PORT" "{{ dev2_ssh_user }}@${HOST}" \
"wget -O '{{ dev2_image_path }}' 'https://cloud.ikeja.co.za/firmwares/uboot/{{ bootenv_filename }}'"
"{{ image_filename }}" "{{ dev2_ssh_user }}@${HOST}:{{ dev2_ssh_user == 'root' | ternary('/', '') }}{{ dev2_image_dir }}/"
args:
executable: /bin/bash
register: scp_bootenv
register: scp_push
changed_when: true
- name: Compute md5 of image on DEV2 after copy (or if already present)
when: local_img.stat.exists and dev2_passfile_used != "NONE" and not (_blocked | default(false))
delegate_to: localhost