--- - name: Install php package: state: latest name: - php-fpm - php-gd - php-imap - php-pgsql - name: enable extension notify: restart php-fpm lineinfile: path: /etc/php/php.ini regexp: ';extension={{ item }}' line: "extension={{ item }}" with_items: - curl - gd - imap - pgsql - pdo_pgsql - mysqli - pdo_mysql - zip - name: enabled and started php-fpm systemd: name: php-fpm enabled: yes state: started - name: templates php nginx notify: reload nginx template: src: "php.nginx" dest: "/etc/nginx/snippets/php.conf"