Your playbook should look like so:

---
- hosts: XYZ
  become: yes

  pre_tasks:
    - name: Add repository for old PHP
      apt_repository:
        repo: ppa:ondrej/php
        update_cache: yes
        state: present

  roles:
    - role: geerlingguy.apache
      ...

    - role: geerlingguy.php
      php_webserver_daemon: apache2
      php_default_version_debian: "7.1"
      php_version: "7.1"
      php_packages:
        - php7.1
        - php7.1-cli
        - etc...

I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.

Leave a Reply

Your email address will not be published. Required fields are marked *