# Upgrade package with dependency

**URL:** <https://forum.ansible.com/t/upgrade-package-with-dependency/3359>\
**Category:** Get Help\
**Tags:** yum, playbook\
**Created:** [January 18, 2024, 12:56am UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359 "2024-01-18T00:56:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasonroot1](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jasonroot1](https://forum.ansible.com/u/Jasonroot1)\
**Post date:** [January 18, 2024, 12:56am UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359/1 "2024-01-18T00:56:41Z")

</div>

I have a problem when upgrading gpfs packages using ansible. When executing the update using the module it always fails due ta dependency between packages that are in the same upgrade

 ![IMG_1927](https://us1.discourse-cdn.com/ansible/original/2X/5/5ba4ee0f2f756e8e371dad8a16df464bbe0f3538.jpeg)

---

<div class="post-metadata">

**Author:** ![Leo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leo/32/23_2.png) [@Leo](https://forum.ansible.com/u/Leo)\
**Post date:** [January 19, 2024, 8:05pm UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359/2 "2024-01-19T20:05:55Z")

</div>

Hi @Jasonroot1 , welcome to the Ansible Community Forum!

Let me give you a couple of tips so you others can help.

You can copy and paste the content of the playbook here instead of pasting an image, and use the \</\> button in the toolbar right in the text box you are writing, to give it format. This should help when someone wants to point to a section or provide advice.

From the screenshot it’s not clear how that task is working or what the scope is, I can understand you are trying to install multiple rpms from a local directory, but I’m not sure why you are listing `with_items`, when using the `shell` task with the `*.rpm`.

I would advise you to use the [yum module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/yum_module.html) and list each package name individually with their fullname (with a `loop` or `with_items` if you wish to avoid multiple tasks) , instead of the `*.rpm`

```auto

- name: Install nginx rpm from a local file
  ansible.builtin.yum:
    name: /usr/local/src/nginx-release-centos-6-0.el6.ngx.noarch.rpm
    state: present

```

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 19, 2024, 8:10pm UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359/3 "2024-01-19T20:10:17Z")

</div>

There are two different classes of issue here: Ansible and package management. I’m only addressing one of the Ansible issues, which is: You are looping over a list of dicts, but you don’t seem to be using any of the loop’d items. That is, your task never uses `{{ item.name }}` from what I can see. Maybe settle on a strategy of either wild card matching in the shell, or looping, but maybe not both.

---

<div class="post-metadata">

**Author:** ![Jasonroot1](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jasonroot1](https://forum.ansible.com/u/Jasonroot1)\
**Post date:** [January 19, 2024, 8:49pm UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359/4 "2024-01-19T20:49:47Z")

</div>

but what I want is to update, update an already installed version

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 19, 2024, 10:58pm UTC](https://forum.ansible.com/t/upgrade-package-with-dependency/3359/5 "2024-01-19T22:58:11Z")

</div>

I think you need to be using the “installation toolkit” to coordinate such an upgrade. That’s beyond the scope of “normal” `yum` or `dnf` operations. You should be following this documentation set:

> **[Overview of the installation toolkit](https://www.ibm.com/docs/en/storage-scale/5.1.9?topic=toolkit-overview-installation)**
>
> The installation toolkit automates the steps that are required to install IBM Storage Scale, deploy protocols, and upgrade to a later IBM Storage Scale release.
