# yum module does not support yum --config=http://file-location

**URL:** <https://forum.ansible.com/t/yum-module-does-not-support-yum-config-http-file-location/22739>\
**Category:** Ansible Developer\
**Created:** [October 7, 2016, 2:33pm UTC](https://forum.ansible.com/t/yum-module-does-not-support-yum-config-http-file-location/22739 "2016-10-07T14:33:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus.gothe](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@markus.gothe](https://forum.ansible.com/u/markus.gothe)\
**Post date:** [October 7, 2016, 2:33pm UTC](https://forum.ansible.com/t/yum-module-does-not-support-yum-config-http-file-location/22739/1 "2016-10-07T14:33:22Z")

</div>

Hello,

I just discoverd that the yum module does not support the yum option -c or --config as it is supposed to be.

According to man yum (and successfully tested on commandline):

-c, --config=[config file]

Specifies the config file location - can take HTTP and FTP URLs and local file paths.

But in the module code you have the following in yum\_base, list\_stuff and ensure:

if conf\_file and os.path.exists(conf\_file):

This of course will never work for a config file that starts with http:// or ftp for that matter.  
Removing the os.path.exists check made the yum module work with the config file passed as conf\_file=[http://hostaddress/repodef.repo](http://hostaddress/repodef.repo)

I know this might be a seldom used feature, but in our case it was needed to get a package installed on machines that dont have general access to a yum repo.  
(and that package was needed to enable ansible file operations, so simply copying a temporary repo definition over via ansible was also no option)

Thats why I suggest to either remove the os.path.exists check, or only use it when the conf\_file string does not contain http:// or ftp://

Kind regards  
Markus

---

<div class="post-metadata">

**Author:** ![alikins](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@alikins](https://forum.ansible.com/u/alikins)\
**Post date:** [October 11, 2016, 8:01pm UTC](https://forum.ansible.com/t/yum-module-does-not-support-yum-config-http-file-location/22739/2 "2016-10-11T20:01:28Z")

</div>

Sounds like a good candidate for a ansible-modules-core issue at  
[https://github.com/ansible/ansible-modules-core/issues](https://github.com/ansible/ansible-modules-core/issues)

(Would the yum\_repository module be useful in this case?  
[http://docs.ansible.com/ansible/yum\_repository\_module.html](http://docs.ansible.com/ansible/yum_repository_module.html))
