Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

PHP Roles Collection for Ansible

Build Status

This collection contains all the PHP-related roles maintained by Jeff Geerling (geerlingguy).

It includes:


Install this collection locally:

ansible-galaxy collection install geerlingguy.php_roles -p ./collections

Then you can use the roles from the collection in your playbooks:

- hosts: all

    - geerlingguy.php_roles

    - php
    - role: php-versions
        php_version: '7.3'

If you want to be more explicit, you can use the fully-qualified role name when referring to a role in this collection, like geerlingguy.php_roles.php instead of just php. This could be helpful if, for example, you maintain a separate php role in another place on your local workstation.


Currently, all the PHP roles (inside roles/) are Git submodules, and work on the roles themselves should take place in the upstream Role repository. At some point, the roles might move into this repository for their canonical home.

This collection has some integration tests (inside tests/), however, which pull all the roles together and ensure they work in tandem on the latest supported platforms.

The integrated tests use ansible-test. You can run them with the following command:

ansible-test integration --docker geerlingguy/docker-ubuntu1804-ansible

Note: You can switch out ubuntu1804 with any other supported operating system (e.g. centos7).

Pushing a new version

Before tagging a new version, make sure all the git submodules are up to date:

git submodule update --recursive --remote

Then commit and push all changes, and make sure all tests are passing.

Then tag the new version of the collection and push the tag.

Once pushed, if tests pass, Travis CI will deploy the new collection version using the playbook in scripts/deploy.yml. That directory also contains the galaxy.yml template that will be used to build the collection metadata.


This collection was created in 2019 by Jeff Geerling, author of Ansible for DevOps and Ansible for Kubernetes.


Collection of PHP roles for Ansible



No packages published