Skip to content

Commit

Permalink
fix(ansible): assert if intel mev acc or imc versions not found
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb authored May 28, 2024
1 parent 1af5d43 commit 940dcf1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lab/ansible/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
register: result
- ansible.builtin.set_fact: acc_run_version={{ result.stdout | trim }}
- ansible.builtin.debug: var=acc_run_version
- ansible.builtin.fail: msg="Could not find ACC string in the running {{ acc_run_version }}"
when: not '"ACC" in acc_run_version'

- name:
hosts: mevbmc
Expand All @@ -205,6 +207,8 @@
- ansible.builtin.debug: var=imc_run_version
- ansible.builtin.shell: /usr/bin/ipu-update -i
- ansible.builtin.debug: var=hostvars.mev.acc_run_version
- ansible.builtin.fail: msg="Could not find IMC string in the running {{ imc_run_version }}"
when: not '"IMC" in imc_run_version'

- name: Upgrade Intel Mev IMC FW to {{ imc_version }}
when: not imc_version in imc_run_version
Expand All @@ -222,15 +226,15 @@
delegate_to: localhost
ansible.builtin.stat: path={{ imc_local_file }}
register: imc_local_file_check

- name: Copy and Unpack {{ imc_local_file }} into remote /work folder
when: imc_local_file_check.stat.exists
ansible.builtin.unarchive: src={{ imc_local_file }} dest=/work

- name: Check again if firmware image exists remotely {{ imc_remote_file }} after copy and unpack
ansible.builtin.stat: path={{ imc_remote_file }}
register: imc_remote_file_check

# FW file exists, use it to start upgrade

- name: Start upgrade Intel Mev IMC FW using existing {{ imc_remote_file }}
Expand Down Expand Up @@ -259,15 +263,15 @@
delegate_to: localhost
ansible.builtin.stat: path={{ acc_local_file }}
register: acc_local_file_check

- name: Copy and Unpack {{ acc_local_file }} into remote /work folder
when: acc_local_file_check.stat.exists
ansible.builtin.unarchive: src={{ acc_local_file }} dest=/work

- name: Check again if firmware image exists remotely {{ acc_remote_file }} after copy and unpack
ansible.builtin.stat: path={{ acc_remote_file }}
register: acc_remote_file_check

# FW file exists, use it to start upgrade

- name: Start upgrade Intel Mev ACC FW using existing {{ acc_remote_file }}
Expand Down

0 comments on commit 940dcf1

Please sign in to comment.