---
- name: Ensure configuration directories exist
  ansible.windows.win_file:
    path: "{{ item }}"
    state: directory
  with_flattened:
    - "{{ php_conf_paths }}"
    - "{{ php_extension_conf_paths }}"

- name: Place PHP configuration file in place # noqa 208
  template:
    src: php.ini.j2
    dest: "{{ item }}/php.ini"
    backup: true
  loop: "{{ php_conf_paths }}"
  notify: restart nginx windows
  when: php_use_managed_ini
