--- - name: Add packages.sury.org key ansible.builtin.apt_key: url: https://packages.sury.org/php/apt.gpg keyring: /etc/apt/trusted.gpg.d/packages.sury.org-php.gpg when: php_use_sury_repo - name: Add packages.sury.org ansible.builtin.apt_repository: filename: packages.sury.org-php.list repo: "deb https://packages.sury.org/php/ {{ ansible_facts.distribution_release }} main" state: "{{ php_use_sury_repo | ternary('present', 'absent') }}" - name: Install dependencies ansible.builtin.apt: name: - "imagemagick" - "{{ php }}" - "{{ php }}-fpm" - "{{ php }}-cli" - "{{ php }}-bcmath" - "{{ php }}-bz2" - "{{ php }}-curl" - "{{ php }}-gd" - "{{ php }}-gmp" - "{{ php }}-imagick" - "{{ php }}-intl" - "{{ php }}-mbstring" - "{{ php }}-mysql" - "{{ php }}-redis" - "{{ php }}-xml" - "{{ php }}-zip" vars: php: "php{{ php_version }}"