---

- name: Install php
  apt:
    name: ['php-fpm', 'php-cli',
           'php-mysql', 'php-intl', 'php-curl', 'php-memcached', 'php-imagick',
           'php-mcrypt', 'php-xml', 'php-mbstring', 'php-zip', 'memcached', 'composer']
    update_cache: yes
    cache_valid_time: 36000
    state: latest

- name: Remove default fpm pool
  file:
    path: /etc/php/7.0/fpm/pool.d/www.conf
    state: absent
  notify: reload php-fpm

- name: Drop php-fpm configuration
  template:
    src: tatoeba.conf
    dest: /etc/php/7.0/fpm/pool.d
    owner: root
    group: root
    mode: 0640
  notify: reload php-fpm

# Desired state

- name: Start/Enable php-fpm
  service:
    name: php7.0-fpm
    state: started
    enabled: yes

---

- name: Install php
  apt:
    name: ['php-fpm', 'php-cli',
           'php-mysql', 'php-intl', 'php-curl', 'php-memcached', 'php-imagick',
           'php-mcrypt', 'php-xml', 'php-mbstring', 'php-zip', 'memcached', 'composer']
    update_cache: yes
    cache_valid_time: 36000
    state: latest

- name: Remove default fpm pool
  file:
    path: /etc/php/7.3/fpm/pool.d/www.conf
    state: absent
  notify: reload php-fpm

- name: Drop php-fpm configuration
  template:
    src: tatoeba.conf
    dest: /etc/php/7.3/fpm/pool.d
    owner: root
    group: root
    mode: 0640
  notify: reload php-fpm

# Desired state

- name: Start/Enable php-fpm
  service:
    name: php7.3-fpm
    state: started
    enabled: yes

Switch from PHP 7.0 to 7.3
Switch from PHP 7.0 to 7.3

Debian Buster uses PHP version 7.3 by default.
