Get conf checksum directly for localhost CP loadbalancer (#12632)

There is no need to stat the templated file, because the template module
already returns a checksum.
This commit is contained in:
Max Gautier
2025-10-24 05:57:36 +00:00
committed by GitHub
parent c6926eb2f9
commit 5acde6cfe2
4 changed files with 4 additions and 18 deletions

View File

@@ -18,14 +18,7 @@
owner: root
mode: "0755"
backup: true
- name: Haproxy | Get checksum from config
stat:
path: "{{ haproxy_config_dir }}/haproxy.cfg"
get_attributes: false
get_checksum: true
get_mime: false
register: haproxy_stat
register: haproxy_conf
- name: Haproxy | Write static pod
template:

View File

@@ -18,14 +18,7 @@
owner: root
mode: "0755"
backup: true
- name: Nginx-proxy | Get checksum from config
stat:
path: "{{ nginx_config_dir }}/nginx.conf"
get_attributes: false
get_checksum: true
get_mime: false
register: nginx_stat
register: nginx_conf
- name: Nginx-proxy | Write static pod
template:

View File

@@ -7,7 +7,7 @@ metadata:
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: kube-haproxy
annotations:
haproxy-cfg-checksum: "{{ haproxy_stat.stat.checksum }}"
haproxy-cfg-checksum: "{{ haproxy_conf.checksum }}"
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet

View File

@@ -7,7 +7,7 @@ metadata:
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: kube-nginx
annotations:
nginx-cfg-checksum: "{{ nginx_stat.stat.checksum }}"
nginx-cfg-checksum: "{{ nginx_conf.checksum }}"
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet