# Is it possible to do a yum update via yum module?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153>\
**Category:** Ansible Project\
**Created:** [November 28, 2017, 4:20pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153 "2017-11-28T16:20:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [November 28, 2017, 4:20pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/1 "2017-11-28T16:20:31Z")

</div>

I believe the answer to my question is “No” since I don’t see it documented in [yum - Manages packages with the yum package manager](http://docs.ansible.com/ansible/latest/yum_module.html) but thought I would ask. For example if I have gitlab-ce-8.14.3 and want to update to gitlab-ce-10.2.1 (latest) I’d do a yum update on CLI. The only way I’m able to do this in Ansible yum module is to remove the current version and install the new one.

Thanks!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 28, 2017, 4:28pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/2 "2017-11-28T16:28:37Z")

</div>

Set "state: latest" and yum will upgrade to the latest version.

If you read under the name in the docs it also explains how to do "yum upgrade".

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [November 28, 2017, 5:02pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/3 "2017-11-28T17:02:25Z")

</div>

Yeah I understand that, and maybe my question was flawed. In my case I wanted to upgrade to “latest” but what if someone else didn’t. What if someone wanted to upgrade from gitlab-ce v8.14.3 to v9.4.2 (two versions behind latest) for example?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 28, 2017, 5:10pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/4 "2017-11-28T17:10:50Z")

</div>

I don't use yum with Gitlab, but usually it's just appending the version to the name, so something like name: gitlab-ce-9.4.2  
You would need to check the correct version Gitlab is using on there packages.

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [November 28, 2017, 5:34pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/5 "2017-11-28T17:34:15Z")

</div>

Gitlab is just an example, it can be any package.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [November 28, 2017, 5:36pm UTC](https://forum.ansible.com/t/is-it-possible-to-do-a-yum-update-via-yum-module/26153/6 "2017-11-28T17:36:01Z")

</div>

My answer still hold, just append the version to the name.
