# Can I do yum localinstall with the yum module?

**URL:** <https://forum.ansible.com/t/can-i-do-yum-localinstall-with-the-yum-module/17275>\
**Category:** Ansible Project\
**Created:** [January 14, 2015, 11:25pm UTC](https://forum.ansible.com/t/can-i-do-yum-localinstall-with-the-yum-module/17275 "2015-01-14T23:25:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_McMahon](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Jim\_McMahon](https://forum.ansible.com/u/Jim_McMahon)\
**Post date:** [January 14, 2015, 11:25pm UTC](https://forum.ansible.com/t/can-i-do-yum-localinstall-with-the-yum-module/17275/1 "2015-01-14T23:25:49Z")

</div>

With the Ansible yum module, can I install an RPM that is local to the server that I’m deploying to? In other words, can I do something like this using ansible, but using the yum module?

- name: locally install mysql-community-release rpm (configures yum)  
sudo: true  
shell: yum localinstall ~{{ install\_user }}/RPMs/{{ mysql\_community\_rpm }} -y  
tags:
- mysql-client

The yum module gives this example:

```auto
- name: install nginx rpm from a local file
  yum: name=/usr/local/src/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present

```

But is this the same as yum localinstall? Or, does this install an RPM on the destination that exists on the machine I running ansible-playbook from?

---

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [January 15, 2015, 12:58pm UTC](https://forum.ansible.com/t/can-i-do-yum-localinstall-with-the-yum-module/17275/2 "2015-01-15T12:58:23Z")

</div>

If I’m not wrong it acts like the yum command, if the rpm exist locally the yum module will just work like the yum localinstall command.

In your example this will install the RPM on the destination system as long you don’t have anywhere defined “connection: local or local\_action” .

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [January 15, 2015, 3:36pm UTC](https://forum.ansible.com/t/can-i-do-yum-localinstall-with-the-yum-module/17275/3 "2015-01-15T15:36:20Z")

</div>

It's the same as yum localinstall in that the rpm needs to be present  
on the remote system. If you have it on the local system, do a copy  
task first to copy it remotely then use the yum module to install it.

-Toshio
