Skip to content

idealista/php_role

Repository files navigation

Logo

PHP Ansible role

Build Status

This Ansible role installs PHP (optionally, with FPM enabled) in a Debian environment.

Getting Started

These instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install PHP in a Debian system.

Prerequisities

Ansible >= 2.9.x.x version installed. Inventory destination should be a Debian environment.

For testing purposes, Molecule (version 3.x) with Docker as provider.

Installing

Create or add to your roles dependency file (e.g requirements.yml):

- src: idealista.php_role
  version: 3.0.0
  name: php

Install the role with ansible-galaxy command:

ansible-galaxy install -p roles -r requirements.yml -f

Use in a playbook:

---
- hosts: someserver
  roles:
    - role: php

Usage

Look to the defaults properties file to see all possible configuration properties.

If you also want to install composer set the variable php_composer_install to true. Also its version can be changed by overriding the variable php_composer_version.

Testing

First, we initialize a virtualenv:

pipenv shell
pipenv sync

To test all possible scenarios:

molecule test --all

To test default scenario (bare installation, no FPM):

molecule test -s default

To test FPM installed scenario:

molecule test -s fpm

Built With

Ansible Molecule Goss

Versioning

For the versions available, see the tags on this repository.

Additionaly you can see what change in each version in the CHANGELOG.md file.

Authors

See also the list of contributors who participated in this project.

License

Apache 2.0 Licence

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.