1708
This commit is contained in:
@@ -1157,22 +1157,29 @@
|
|||||||
register: dev2_md5_before
|
register: dev2_md5_before
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Copy image to DEV2 if missing or md5 mismatch
|
- 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_md5_before.stdout | trim) != image_md5)
|
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
|
delegate_to: localhost
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -e
|
set -e
|
||||||
HOST="{{ dev2_ssh_host }}"
|
HOST="{{ dev2_ssh_host }}"
|
||||||
PORT="{{ dev2_ssh_port }}"
|
PORT="{{ dev2_ssh_port }}"
|
||||||
sshpass -f "{{ dev2_passfile_used }}" scp \
|
sshpass -f "{{ dev2_passfile_used }}" ssh \
|
||||||
-P "$PORT" \
|
-o AddressFamily=inet \
|
||||||
-o StrictHostKeyChecking=no -o PubkeyAuthentication=no \
|
-o StrictHostKeyChecking=no -o PubkeyAuthentication=no \
|
||||||
"{{ image_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:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
register: scp_push
|
register: scp_bootenv
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
|
|
||||||
- name: Compute md5 of image on DEV2 after copy (or if already present)
|
- 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))
|
when: local_img.stat.exists and dev2_passfile_used != "NONE" and not (_blocked | default(false))
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|||||||
Reference in New Issue
Block a user