--- - name: "[Alpine] Install package: php7 php7-fpm" apk: name: "php7 php7-fpm" state: present when: - ansible_distribution == "Alpine" - services.php_fpm.version is not defined or services.php_fpm.version == 7 - name: "[Alpine] Install package: php8 php8-fpm" apk: name: "php8 php8-fpm" state: present when: - ansible_distribution == "Alpine" - services.php_fpm.version == 8 - name: "[Archlinux] Install package: php7 php7-fpm" pacman: name: - "php7" - "php7-fpm" state: present when: - ansible_distribution == "Archlinux" - services.php_fpm.version is not defined or services.php_fpm.version == 7 - name: "[Archlinux] Install package: php php-fpm" pacman: name: - "php" - "php-fpm" state: present when: - ansible_distribution == "Archlinux" - services.php_fpm.version == 8