I am writing my first ansible playbook and try to configure php 7 by using already existing roles. I found 2 roles that nearly suit my needs but both of them do not offer the flexibility I want for creating `php.ini` files.

1. <https://github.com/itcraftsmanpl/ansible-role-php7>

This role uses a task called `php-fpm.yml` to change lines in a already existing `php.ini` file using

```
- name: Ensure timezone is set in fpm php.ini
  lineinfile: dest=/etc/php/7.1/fpm/php.ini
              regexp='date.timezone ='
              line='date.timezone = {{ php_timezone }}'

```

2. <https://github.com/geerlingguy/ansible-role-php/>

This role uses a template for generating the `php.ini` and inserts certain predefined variables to make it configurable.

```
date.timezone = {{ php_date_timezone }}

```

Question:

Is it possible to add a new configuration directive (let's say for setting `mysqli.max_persistent=XYZ`) without overwriting the files of the above mentioned roles? Or do I have to stick to those config options the roles provide?

How should I in general extend a already existing role without tampering the file base of the role?

My current playbook.yml is as simple as this:

```
- name: Install PHP 7
  hosts: all
  become: yes

  roles:
   - ansible-role-php7

```