I have a strange problem with Ansible that I use to install / update / manage my webservers.

I have an installation script that is supposed to make sure that I always have the latest PHP5 module in my Debian 6 / Apache 2 system:

  - name: install apache2 and php5
    action: apt pkg=$item state=latest
      - apache2
      - php5
      - libapache2-mod-php5
      - php5-curl
      - restart apache

It usually works great, but once every few runs I end up with mod-php5-filter in my apache instead of mod-php5 - which is bad for various reasons (mainly for breaking everything).

All I have to do then is run my installation script again - and I'm back to mod-php5

Any ideas? Anything that I might be doing wrong?


I'd suggest that it's being dragged in as a dependency for php5.

apt-cache show php5
Package: php5
Priority: optional
Section: php
Installed-Size: 20
Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Architecture: all
Version: 5.3.3-7+squeeze14
Depends: libapache2-mod-php5 (>= 5.3.3-7+squeeze14) | libapache2-mod-php5filter (>= 5.3.3-7+squeeze14) | php5-cgi (>= 5.3.3-7+squeeze14), php5-common (>= 5.3.3-7+squeeze14)

If it thought libapache2-mod-php5 was unavailable at the time of apt pkg=php5 then it would get the next in the list of dependencies for libapache2-mod-php5filter. Does it happen less if you swap the order of your with_items:?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.