<commit_before>---

- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml"

- name: Fact - php pool on centos
  set_fact:
     php_pool_conf: /etc/php-fpm.d/www.conf
  when: ansible_distribution == 'CentOS'

- name: Fact - php pool on ubuntu
  set_fact:
     php_pool_conf: /etc/php5/fpm/pool.d/www.conf
  when: ansible_distribution == 'Ubuntu'

- name: Configure environment variables from DOCKER_ENVIRONMENT for php-fpm (pool www.conf)
  lineinfile:
    dest:   "{{ php_pool_conf }}"
    regexp: '^env\[{{ item.key }}\][\s]*='
    line:   'env[{{ item.key }}] = "{{ item.value }}"'
  with_dict: "{{ DOCKER_ENVIRONMENT }}"
  when: DOCKER_ENVIRONMENT is defined

- name: Configure environment variables from APPLICATION_ENVIRONMENT for php-fpm (pool www.conf)
  lineinfile:
    dest:   "{{ php_pool_conf }}"
    regexp: '^env\[{{ item.key }}\][\s]*='
    line:   'env[{{ item.key }}] = "{{ item.value }}"'
  with_dict: "{{ APPLICATION_ENVIRONMENT }}"
  when: APPLICATION_ENVIRONMENT is defined

- name: Set development environment php.ini
  file:
    src:  '/opt/docker/etc/php/development.ini'
    dest: '/opt/docker/etc/php/php.ini'
    state: link
    force: yes
  when: PROVISION_CONTEXT == "development" or PROVISION_CONTEXT == ""

- name: Enable production environment php.ini
  file:
    src:  '/opt/docker/etc/php/production.ini'
    dest: '/opt/docker/etc/php/php.ini'
    state: link
    force: yes
  when: PROVISION_CONTEXT == "production"<commit_msg>Fixed FPM-issue with empty environment vars<commit_after>---

- include_vars: "/opt/docker/etc/application.{{ PROVISION_CONTEXT }}.yml"

- name: Fact - php pool on centos
  set_fact:
     php_pool_conf: /etc/php-fpm.d/www.conf
  when: ansible_distribution == 'CentOS'

- name: Fact - php pool on ubuntu
  set_fact:
     php_pool_conf: /etc/php5/fpm/pool.d/www.conf
  when: ansible_distribution == 'Ubuntu'

- name: Configure environment variables from DOCKER_ENVIRONMENT for php-fpm (pool www.conf)
  lineinfile:
    dest:   "{{ php_pool_conf }}"
    regexp: '^env\[{{ item.key }}\][\s]*='
    line:   'env[{{ item.key }}] = "{{ item.value }}"'
  with_dict: "{{ DOCKER_ENVIRONMENT }}"
  when: DOCKER_ENVIRONMENT is defined and item.value != ''

- name: Configure environment variables from APPLICATION_ENVIRONMENT for php-fpm (pool www.conf)
  lineinfile:
    dest:   "{{ php_pool_conf }}"
    regexp: '^env\[{{ item.key }}\][\s]*='
    line:   'env[{{ item.key }}] = "{{ item.value }}"'
  with_dict: "{{ APPLICATION_ENVIRONMENT }}"
  when: APPLICATION_ENVIRONMENT is defined and item.value != ''

- name: Set development environment php.ini
  file:
    src:  '/opt/docker/etc/php/development.ini'
    dest: '/opt/docker/etc/php/php.ini'
    state: link
    force: yes
  when: PROVISION_CONTEXT == "development" or PROVISION_CONTEXT == ""

- name: Enable production environment php.ini
  file:
    src:  '/opt/docker/etc/php/production.ini'
    dest: '/opt/docker/etc/php/php.ini'
    state: link
    force: yes
  when: PROVISION_CONTEXT == "production"
{'fraction_non_alphanumeric': 0.15589980224126565, 'fraction_numerical': 0.0006591957811470006, 'mean_word_length': 3.443631039531479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5524277', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1098, 'n_words': 246}