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

21 views
Skip to first unread message

ZillaYT

unread,
Nov 28, 2017, 11:20:31 AM11/28/17
to Ansible Project
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 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!

Kai Stian Olstad

unread,
Nov 28, 2017, 11:29:02 AM11/28/17
to ansible...@googlegroups.com
On Tuesday, 28 November 2017 17.20.31 CET ZillaYT wrote:
> 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.

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".

--
Kai Stian Olstad

ZillaYT

unread,
Nov 28, 2017, 12:02:25 PM11/28/17
to Ansible Project
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?

Kai Stian Olstad

unread,
Nov 28, 2017, 12:11:19 PM11/28/17
to ansible...@googlegroups.com
On Tuesday, 28 November 2017 18.02.25 CET ZillaYT wrote:
> 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?

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.

--
Kai Stian Olstad

ZillaYT

unread,
Nov 28, 2017, 12:34:15 PM11/28/17
to Ansible Project
Gitlab is just an example, it can be any package.

Kai Stian Olstad

unread,
Nov 28, 2017, 12:36:18 PM11/28/17
to ansible...@googlegroups.com
On Tuesday, 28 November 2017 18.34.15 CET ZillaYT wrote:
> Gitlab is just an example, it can be any package.

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


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages