-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yum module, add downloadonly and downloaddir options #24004
Comments
You mean like #23220, just for yum? |
@MarkusTeufelberger yes, it's quite similar, but my focus is also on the fact that the downloaded packages should not simply be available on the yum local cache (which is the expected behaviour in the linked apt module ticket, or with only the downloadonly parameter) but downloaded on a desired location (the downloaddir parameter) to be easily managed afterwards. Currently to do this simple step I have to relay on command module or upload bash script simply to add the two extra parameters to the yum command (this parameters afaik cannot be managed via yum configuration via external file, i.e. via conf_file module parameter ). Probably a more generic "extra_args" to be passed to the yum command like the one available in the PIP module could do this (and many other) tricks. |
Adding the - name: Create managed-epel repository configuration
yum_repository:
name: managed-epel
description: Managed EPEL - CentOS-$releasever
baseurl: "file://{{managed_epel_repository_path}}/"
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
gpgcheck: yes
enabled: yes
- name: Create temporary installroot
shell: mktemp -d
register: installroot
- name: Download ansible
command: >
yum install
--downloadonly
--releasever=/
--installroot={{installroot.stdout}}
--downloaddir={{managed_epel_repository_path}}
--disablerepo=*
--enablerepo=managed-centos-media,epel
ansible
- name: Update managed-epel repository database
command: createrepo --update --database {{managed_epel_repository_path}} Of course, the change check for the |
1 similar comment
+1 for this request. |
FWIW I'm on board with the change but I don't see myself being able to prioritize it anytime soon. If anyone would like to contribute a pull request, I would be happy to review. |
For those like me who keep getting this page in their searches, in Ansible 2.7 the |
And for everyone else in the future: https://docs.ansible.com/ansible/latest/modules/yum_module.html |
ISSUE TYPE
COMPONENT NAME
yum module
SUMMARY
add parameters to yum module to support downloadonly and downloaddir parameters
from yum install --help
this is quite useful to use yum to download RPM packages once to be installed elsewhere (e.g. subnets with no direct internet access)
The text was updated successfully, but these errors were encountered: