The way I’ve found around the with_items yum/apt problem is to make a dummy RPM that pulls in all the packages you’d want to iterate through with $item, and then configure yum on the target instance with a private repo. Then, use action: yum to pull in the dummy package.
for that issue – We really should just make the yum (and apt) module support taking a list. This has been discussed before and could be done with some tweaks in runner code such that with_items looks the same way it does now, but is evaluated differently.
Meta packages are a bit much to ask of people I think, but yes, that’s a decent workaround many people employ with various tools.
I’d say work it out with skvidal whether supporting a local install makes sense and whether pkg=/path/to/foo.rpm is the best way of expressing that. I don’t object but Seth gets to make the call as to whether he thinks it’s reasonable and messes with the other capabilities of the module too much.
Using yum for the heavy lifing because:
- you get dependency resolution and pre/post installation scripts for free
- it’s much, much, much faster than using ansible’s ‘yum’ action a zillion times
- you can sign your packages (creates accountability and raises security)
- you can ‘yum undo’ and ‘yum history’ to reverse adverse outcomes.
It would make it even simpler/faster/more beautiful if there were a low-level ‘package’ action that let me do the equivalent of ‘yum localinstall http://overlord.local:some_port/RPMS/quux.rpm?internal_and_private_ansible_secret=1234’ We could use Tornado on the overlord machine and serve ~ansible/packages/ off some_port, and then the playbook action could be as simple as ‘package rpm=quux’ (or ‘package deb=quux’ depending on the platform.) Then the package’s postinstall hookscript could do most of the heavy lifting. As a bonus, on Fedora you get 'yum history and ‘yum undo’. On both Fedora and Debian-derived systems, you also get package and repo keysigning. These are niceties that ansible lacks (and rightly so.)
Interesting. Trying to lock down licensed content or count installations, perhaps?
Last approach I saw to this in-house control was this: https://lists.dulug.duke.edu/pipermail/yum-devel/2006-November/002856.html
108 got slain. I’m really not sure how useful it would be either.
Speaking of which: although I think an ‘$items’ syntax would be great, one of the things about ansible I most appreciate is how the project (seems to) recognize how much of the work taken on by other DevOps CNC systems is wheel-reinvention. Apt-get appeared in what year? 1998 or something? We’ve had dependency resolution with event hooks since that long, folks. On Fedora, we’ve had it at least since the switch to Yum, possibly earlier (depending on your opinion of Up2date). We didn’t have to wait for Puppet and Chef. ;D Thanks, Mike, for winnowing the stack. Please don’t screw it up by adding a bunch of new stuff! ;D (I know you wouldn’t, that’s why I love ansible.)
I’m strongly not for adding a lot of new stuff, but I also don’t believe you should need to make a meta-package for all of your possible package combinations, or need to know rpmbuild to need to use Ansible efficiently.
For instance, if you want Cobbler + Nagios, a package that is “my-magic-managemnet-server.rpm” is a bit much. That’s not dependency resolution, that’s installing two different things on the same box.
So I think it’s still worthwhile to let those take lists, and to let “with_items” be magical for yum/apt…. if it just does what you mean, that’s ok.
But yeah, I will be pushing back on continual new syntax. What I like the most about this idea is it’s reusing syntax we already have.