apt install with version wildcards

Hi,

I’m trying to use version wildcards while installing apt packages, like so:

apt: pkg=php5=5.4.*

Since those packages are being updated in the repository, I cannot hardcode a precise version number. However, on some systems the default php5 package may not correspond to version 5.4, so I need to add a version restriction of some sort. Ansible does not seem to support this syntax, failing with “msg: pkgname wildcard and version can not be mixed”.

Is there any elegant solution to this?

Cheers,
David

Hi,

It looks like you can’t use both = and * in the package name: https://github.com/ansible/ansible/blob/devel/library/packaging/apt#L233-L235
I’ve created https://github.com/ansible/ansible/issues/6885 for that.

Cheers,
Timur