Skip to content

Commit dc7b24e

Browse files
authored
Php unix socket pr 1.x (#726)
* Moving cachetool adapter setup to the installer role and adding a test. * Updating cachetool documentation. * Making sure _cachetool_adapter is always set.
1 parent 6b8eb88 commit dc7b24e

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

roles/_init/tasks/drupal7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import_role:
1212
name: cli/drush
1313

14-
- name: Ensure we have a cachetool binary.
14+
- name: Ensure we have a cachetool binary and configuration.
1515
ansible.builtin.import_role:
1616
name: cli/cachetool
1717
when: install_php_cachetool

roles/_init/tasks/drupal8.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
ansible.builtin.set_fact:
1212
drush_live_bin: "{{ drush_live_bin | default('{{ live_symlink_dest }}/vendor/bin/drush') }}"
1313

14-
- name: Ensure we have a cachetool binary.
14+
- name: Ensure we have a cachetool binary and configuration.
1515
ansible.builtin.import_role:
1616
name: cli/cachetool
17-
when:
18-
- install_php_cachetool
19-
- deploy_operation == 'deploy'
17+
when: install_php_cachetool

roles/cli/cachetool/tasks/main.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
- name: Remove previous cachetool if exists.
3-
ansible.builtin.file:
4-
path: "{{ cachetool_bin }}"
5-
state: absent
6-
when:
7-
- deploy_operation == 'deploy'
2+
- name: Initial housekeeping tasks.
3+
when: deploy_operation == 'deploy'
4+
block:
5+
- name: Remove previous cachetool if exists.
6+
ansible.builtin.file:
7+
path: "{{ cachetool_bin }}"
8+
state: absent
89

9-
- name: Ensure bin directory exists.
10-
ansible.builtin.file:
11-
path: "{{ cachetool_bin | dirname }}"
12-
state: directory
13-
when:
14-
- deploy_operation == 'deploy'
10+
- name: Ensure bin directory exists.
11+
ansible.builtin.file:
12+
path: "{{ cachetool_bin | dirname }}"
13+
state: directory
1514

1615
- name: Download cachetool depending on latest php version installed. # If not specified manually, according to https://github.com/gordalina/cachetool#compatibility
1716
when:
@@ -84,7 +83,7 @@
8483
- cachetool.version is defined
8584
- cachetool.version | length > 0
8685

87-
# Set up cachetool adapter
86+
# Set up cachetool adapter - needs to happen on every run so _cachetool_adapter is set.
8887
- name: Get latest PHP version installed.
8988
ansible.builtin.shell:
9089
cmd: 'set -o pipefail && ls -1 /etc/php/ | while read ver; do if [ -d "/etc/php/$ver/fpm" ]; then echo "$ver"; fi; done | tail -1'

0 commit comments

Comments
 (0)