PHP Roles Collection for Ansible
This collection contains all the PHP-related roles maintained by Jeff Geerling (geerlingguy).
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 collections: - geerlingguy.php_roles roles: - php - role: php-versions vars: 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.phpinstead of just
php. This could be helpful if, for example, you maintain a separate
phprole 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
ubuntu1804with any other supported operating system (e.g.
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.