---
- name: Build | Install PHP70 with dependencies
  apt: "pkg={{ item }} state=present"
  environment:
    LC_CTYPE: en_US.UTF-8
  with_items: blackroom_php70_packages
  tags:
    - build
    - php7

- name: Build | Configure PHP70
  lineinfile: "dest={{ item.dest }} regexp='{{ item.regexp }}' line='{{ item.line }}' state=present"
  with_items:
      - { dest: /etc/php/7.0/fpm/pool.d/www.conf, regexp: "^listen =", line: "listen = {{ blackroom_php70_fastcgi_pass }}" }
      - { dest: /etc/php/7.0/fpm/php.ini, regexp: '^;date.timezone', line: "date.timezone = {{ blackroom_php70_timezone }}" }
      - { dest: /etc/php/7.0/cli/php.ini, regexp: '^;date.timezone', line: "date.timezone = {{ blackroom_php70_timezone }}" }
      - { dest: /etc/php/7.0/cli/conf.d/20-xdebug.ini, regexp: '^zend_extension=xdebug.so', line: ';zend_extension=xdebug.so' }
  notify:
    - restart php-fpm
  tags:
    - build
    - php7

---
- name: Build | Install PHP70 with dependencies
  apt: "pkg={{ item }} state=present"
  environment:
    LC_CTYPE: en_US.UTF-8
  with_items: blackroom_php70_packages
  tags:
    - build
    - php7

- name: Build | Configure PHP70
  lineinfile: "dest={{ item.dest }} regexp='{{ item.regexp }}' line='{{ item.line }}' state=present"
  with_items:
      - { dest: /etc/php/7.0/fpm/pool.d/www.conf, regexp: "^listen =", line: "listen = {{ blackroom_php70_fastcgi_pass }}" }
      - { dest: /etc/php/7.0/fpm/php.ini, regexp: '^;date.timezone', line: "date.timezone = {{ blackroom_php70_timezone }}" }
      - { dest: /etc/php/7.0/cli/php.ini, regexp: '^;date.timezone', line: "date.timezone = {{ blackroom_php70_timezone }}" }
  tags:
    - build
    - php7

- name: Build | Remove xdebug for cli
  file: path=/etc/php/7.0/cli/conf.d/20-xdebug.ini state=absent
  notify:
    - restart php-fpm
  tags:
    - build
    - php7

Update php70 role for cli
Update php70 role for cli
