Switching over to using unix sockets for ICP

This commit is contained in:
2025-11-23 22:50:24 +01:00
parent d814369c99
commit dd62e93517
11 changed files with 157 additions and 26 deletions

View File

@@ -15,6 +15,15 @@
state: directory
mode: '0755'
- name: Create Valkey socket directory
file:
path: /run/valkey
state: directory
owner: valkey
group: valkey
mode: '0755'
when: valkey_unixsocket is defined
- name: Check if Valkey data directory exists
stat:
path: "/var/lib/valkey"
@@ -55,19 +64,31 @@
state: "{{ valkey_service_state }}"
daemon_reload: yes
- name: Wait for Valkey to be ready
- name: Wait for Valkey to be ready (TCP)
wait_for:
port: "{{ valkey_port }}"
host: "{{ valkey_bind }}"
host: "{{ valkey_bind | default('127.0.0.1') }}"
timeout: 30
when: valkey_service_state == "started"
when:
- valkey_service_state == "started"
- valkey_port != 0
- name: Test Valkey connectivity
command: valkey-cli -h {{ valkey_bind }} -p {{ valkey_port }} -a "{{ valkey_password }}" ping
- name: Wait for Valkey Unix socket to be ready
wait_for:
path: "{{ valkey_unixsocket }}"
timeout: 30
when:
- valkey_service_state == "started"
- valkey_unixsocket is defined
- name: Test Valkey connectivity (Unix socket)
command: valkey-cli -s {{ valkey_unixsocket }} -a "{{ valkey_password }}" ping
register: valkey_ping_result
changed_when: false
failed_when: valkey_ping_result.stdout != "PONG"
when: valkey_service_state == "started"
when:
- valkey_service_state == "started"
- valkey_unixsocket is defined
- name: Display Valkey infrastructure status
debug: