From c197d82ff80fefd147dd220b459bc2b76a969f87 Mon Sep 17 00:00:00 2001 From: AnsibleGuy Date: Sun, 25 Aug 2024 16:39:43 +0200 Subject: [PATCH] fix for JA3N extension sorting --- README.md | 1 + tasks/debian/geoip.yml | 1 + tasks/debian/install.yml | 3 ++- tasks/debian/main.yml | 4 ++-- templates/etc/haproxy/lua/ja3n.lua.j2 | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cd041a7..b548aa7 100644 --- a/README.md +++ b/README.md @@ -364,6 +364,7 @@ There are also some useful **tags** available: * config => only update config and ssl certs * ssl or acme * geoip +* lua To debug errors - you can set the 'debug' variable at runtime: ```bash diff --git a/tasks/debian/geoip.yml b/tasks/debian/geoip.yml index 6ced0f8..8b0da35 100644 --- a/tasks/debian/geoip.yml +++ b/tasks/debian/geoip.yml @@ -35,6 +35,7 @@ owner: 'root' group: 'haproxy' mode: 0750 + tags: lua - name: HAProxy | GeoIP | Checking if Lookup-Service Binary exists ansible.builtin.stat: diff --git a/tasks/debian/install.yml b/tasks/debian/install.yml index eef98a6..1ede097 100644 --- a/tasks/debian/install.yml +++ b/tasks/debian/install.yml @@ -98,10 +98,11 @@ name: 'haproxy.service' enabled: true -- name: HAProxy | Install | Add LUA SSL-Fingerprint module +- name: HAProxy | Install | Add LUA SSL-Fingerprint (JA3N) module ansible.builtin.template: src: "templates{{ HAPROXY_HC.path.lua }}/ja3n.lua.j2" dest: "{{ HAPROXY_HC.path.lua }}/ja3n.lua" owner: 'root' group: 'haproxy' mode: 0750 + tags: lua diff --git a/tasks/debian/main.yml b/tasks/debian/main.yml index 5590f4f..3a7b0ed 100644 --- a/tasks/debian/main.yml +++ b/tasks/debian/main.yml @@ -2,7 +2,7 @@ - name: HAProxy | Install ansible.builtin.include_tasks: debian/install.yml - tags: [install] + tags: [install, lua] args: apply: tags: [install] @@ -18,7 +18,7 @@ - name: HAProxy | GeoIP ansible.builtin.include_tasks: debian/geoip.yml when: HAPROXY_CONFIG.geoip.enable | bool - tags: [geoip, config] + tags: [geoip, config, lua] args: apply: tags: [geoip] diff --git a/templates/etc/haproxy/lua/ja3n.lua.j2 b/templates/etc/haproxy/lua/ja3n.lua.j2 index afc6df2..39f43b7 100644 --- a/templates/etc/haproxy/lua/ja3n.lua.j2 +++ b/templates/etc/haproxy/lua/ja3n.lua.j2 @@ -21,7 +21,7 @@ function split_string(str, delimiter) end local function sortNumbers(a, b) - if a == nil or b == nil + if (a == nil or b == nil) then return false end