Skip to content

Commit

Permalink
fix(ansible): refactor intelmev play using delegate
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed May 29, 2024
1 parent c0d0f01 commit 54b446d
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lab/ansible/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,19 @@
project_src: /root/opi-poc/lab
register: output

- name:
- name: Intel | Upgrade Intel Mev IMC and ACC FWs
hosts: mev
become: yes
vars:
imc_version: 1.4.0.8469
imc_local_file: /root/intel-ipu-pldm-image-{{ imc_version }}.tar.gz
imc_remote_file: /work/intel-ipu-pldm-image-{{ imc_version }}/intel-ipu-pldm-{{ imc_version }}.bin
acc_version: "{{ imc_version }}"
acc_local_file: /root/intel-ipu-acc-eval-image-{{ acc_version }}.tar.gz
acc_remote_file: /work/intel-ipu-acc-eval-image-{{ acc_version }}/ACC/OS/acc-os-kernel.bin
ansible_remote_tmp: /tmp
tasks:

- name: Fetch Intel Mev ACC running version
block:
- ansible.builtin.shell: cat /etc/issue
Expand All @@ -193,32 +202,21 @@
- 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
become: yes
vars:
imc_version: 1.4.0.8469
imc_local_file: /root/intel-ipu-pldm-image-{{ imc_version }}.tar.gz
imc_remote_file: /work/intel-ipu-pldm-image-{{ imc_version }}/intel-ipu-pldm-{{ imc_version }}.bin
acc_version: "{{ imc_version }}"
acc_local_file: /root/intel-ipu-acc-eval-image-{{ acc_version }}.tar.gz
acc_remote_file: /work/intel-ipu-acc-eval-image-{{ acc_version }}/ACC/OS/acc-os-kernel.bin
ansible_remote_tmp: /tmp
tasks:
- name: Fetch Intel Mev IMC running version
delegate_to: mevbmc
block:
- ansible.builtin.shell: cat /etc/issue
- ansible.builtin.shell: cat /etc/issue.net
register: result
- ansible.builtin.set_fact: imc_run_version={{ result.stdout | trim }}
- 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
delegate_to: mevbmc
block:
- name: Check if firmware image exists remotely {{ imc_remote_file }}
ansible.builtin.stat: path={{ imc_remote_file }}
Expand Down Expand Up @@ -255,7 +253,8 @@
# TODO: now update ACC using /usr/bin/imc-scripts/acc_os_partition_provision.sh

- name: Upgrade Intel Mev ACC FW to {{ acc_version }}
when: not acc_version in hostvars.mev.acc_run_version
when: not acc_version in acc_run_version
delegate_to: mevbmc
block:
- name: Check if firmware image exists remotely {{ acc_remote_file }}
ansible.builtin.stat: path={{ acc_remote_file }}
Expand Down

0 comments on commit 54b446d

Please sign in to comment.