UNPKG

@installdoc/ansible-gas-station

Version:

An Ansible playbook that provisions your network with software from GitHub Awesome lists, developed with disaster recovery in mind ⛽🔥🤤

39 lines (35 loc) 1.09 kB
--- - name: Check for existing OpCache config files find: paths: "{{ item }}" contains: 'zend_extension(\s+)?=(\s+)?opcache\.so' loop: "{{ php_extension_conf_paths }}" register: php_installed_opcache_confs - name: Remove any non-role-supplied OpCache config files file: path: "{{ item.1.path }}" state: absent when: php_opcache_conf_filename != (item.1.path.split('/') | last) with_subelements: - "{{ php_installed_opcache_confs.results }}" - files notify: restart webserver loop_control: label: item.item - name: Ensure OpCache config file is present template: src: opcache.ini.j2 dest: "{{ item }}/{{ php_opcache_conf_filename }}" owner: root force: true mode: 0644 loop: "{{ php_extension_conf_paths }}" notify: restart webserver when: php_opcache_enable | bool - name: Remove OpCache config file if OpCache is disabled file: path: "{{ item }}/{{ php_opcache_conf_filename }}" state: absent loop: "{{ php_extension_conf_paths }}" notify: restart webserver when: not php_opcache_enable | bool