add shell (fnmatch) style pattern support for the apt module#3569
add shell (fnmatch) style pattern support for the apt module#3569mvo5 wants to merge 3 commits intoansible:develfrom
Conversation
|
Happy to test this, though may I request list comprehensions rather than lambda/filter? Makes things a bit more readable IMHO and also will help us out when these are later deprecated, should we want to make Python 3 versions. I'd like to avoid apt_facts if possible. |
|
Thanks, I updated the code now to avoid the lambda/filter. To test you can e.g. run With "pkg='apt*:i386'" on a modern amd64 ubuntu you should get a bunch of i386 packages that match the pattern. |
|
Looks like this needs to be rebased due to changes in the apt module, can you take care of that? Thanks! |
Conflicts: library/packaging/apt
|
I update the branch now. Please let me know if more is needed. |
|
Hm, I did a git merge instead of a git rebase, let me see if I can fix this, otherwise I will push a new branch. Sorry for that. |
|
Yeah you may be able to fix with a force push, but I'm not sure. I will let you resubmit this one. Thanks! |
|
This commit breaks the ability to install the latest version of package using : |
|
@uvizhe apt: pkg=foo will install the latest already, no? unless you use a special /etc/apt/preferences policy of course. |
|
@mvo5 sure pkg=foo installs the latest. But when you specify package version in variable and you don't know which is the latest this (foo=*) is the only possibility AFAIK. You can't leave variable empty since "apt: pkg=foo=" is illegal in Ansible. |
|
On Fri, Oct 18, 2013 at 04:40:09AM -0700, uvizhe wrote:
Aha, thanks. Now I understand your use case. I think that "apt: Cheers, |
|
@mvo5 thanks! This magically works! |
The policycoreutils python API for RHEL6 and RHEL7 are sufficiently different, requiring some additional definitions and specific conversion that works on old and new implementations. It also implements a fix for non-ascii error messages (like when using a French locale configuration). This fixes #3551.
The policycoreutils python API for RHEL6 and RHEL7 are sufficiently different, requiring some additional definitions and specific conversion that works on old and new implementations. It also implements a fix for non-ascii error messages (like when using a French locale configuration). This fixes ansible#3551.
This branch adds support to install multiple packages via fnmatch style patterns in the "apt" module.
Our use-case is that for a university lab we want to install all r-cran-* packages and this seems to be the simplest way of doing it. The alternative would be to have a "apt_facts" module that exposes the apt cache information maybe? I'm happy to explore that option if you prefer it, but the approach in this branch looks simpler to understand in a playbook.
Feedback welcome!
Thanks,
Michael