# yum: Installroot to empty directory

**URL:** <https://forum.ansible.com/t/yum-installroot-to-empty-directory/30972>\
**Category:** Ansible Project\
**Created:** [August 7, 2019, 9:23am UTC](https://forum.ansible.com/t/yum-installroot-to-empty-directory/30972 "2019-08-07T09:23:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleg\_Kotsar](https://avatars.discourse-cdn.com/v4/letter/o/58956e/32.png) [@Oleg\_Kotsar](https://forum.ansible.com/u/Oleg_Kotsar)\
**Post date:** [August 7, 2019, 9:23am UTC](https://forum.ansible.com/t/yum-installroot-to-empty-directory/30972/1 "2019-08-07T09:23:21Z")

</div>

Hello.

I would like to install the base CentOS to a specify directory, example to /var/centos. The directory is empty. I usage the next command in yum:

`  
yum --disablerepo=‘\*’ --enablerepo=‘base,updates’ --releasever=7 --installroot=/var/centos groupinstall [@core](https://forum.ansible.com/groups/core)

`

This command installs the base system without any problems. I want to do the same through Ansible.

In Ansible I usage the next task:

`

- name: Install base CentOS  
yum:  
state: latest  
name: “[@core](https://forum.ansible.com/groups/core)”  
installroot: “/var/centos/”  
disablerepo: “\*”  
enablerepo: “base,updates”  
releasever: “7”  
`

When executing a playbook I recieve an error:

`  
Cannot find a valid baseurl for repo: base/$releasever/x86\_64

`

As I understand, the yum don’t see any repo. Ok, I make list:

`

- name: Install base CentOS  
yum:  
list: repos  
installroot: “/var/centos/”  
`

When I execute the task I receive nothing.

Why doesn’t yum module see repos? Anybody can help me?
