- name: Install php extensions
  yum:
    name:
      - "{{php_version}}"
      - "{{php_version}}-php-bcmath"
      - "{{php_version}}-php-devel"
      - "{{php_version}}-php-mysqlnd"
      - "{{php_version}}-php-opcache"
      - "{{php_version}}-php-pecl-redis"
      - "{{php_version}}-php-mbstring"
      - "{{php_version}}-php-pear"
      - "{{php_version}}-php-xml"
      - "{{php_version}}-php-pecl-zip"
      - "{{php_version}}-php-ioncube-loader"
    state: installed

- name: Link php directories and php binary
  file:
    src: "{{item.from}}"
    dest: "{{item.to}}"
    state: link
  with_items:
    - {from: "/usr/bin/{{php_version}}", to: '/usr/bin/php'}
    - {from: "/opt/remi/{{php_version}}/root/bin/php-config", to: '/usr/bin/php-config'}
    - {from: "/etc/opt/remi/{{php_version}}", to: '/etc/php'}
    - {from: "/var/opt/remi/{{php_version}}/log/php-fpm", to: '/var/log/php-fpm'}


- name: Tune php
  include: tune-php.yml
- name: Install php extensions
  yum:
    name:
      - "{{php_version}}"
      - "{{php_version}}-php-bcmath"
      - "{{php_version}}-php-devel"
      - "{{php_version}}-php-mysqlnd"
      - "{{php_version}}-php-opcache"
      - "{{php_version}}-php-pecl-redis"
      - "{{php_version}}-php-mbstring"
      - "{{php_version}}-php-pear"
      - "{{php_version}}-php-xml"
      - "{{php_version}}-php-pecl-zip"
      - "{{php_version}}-php-ioncube-loader"
    state: installed

- name: Link php directories and php binary
  file:
    src: "{{item.from}}"
    dest: "{{item.to}}"
    state: link
  with_items:
    - {from: "/usr/bin/{{php_version}}", to: '/usr/bin/php'}
    - {from: "/opt/remi/{{php_version}}/root/bin/php-config", to: '/usr/bin/php-config'}
    - {from: "/etc/opt/remi/{{php_version}}", to: '/etc/php'}


- name: Tune php
  include: tune-php.yml
Make symling to php-fpm log after installing php-fpm
Make symling to php-fpm log after installing php-fpm
