GHP publish
This commit is contained in:
2
roles/metallb/defaults/main.yaml
Normal file
2
roles/metallb/defaults/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
strict_arp_for_metallb: true
|
||||
metallb_default_values: {}
|
32
roles/metallb/tasks/main.yaml
Normal file
32
roles/metallb/tasks/main.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
- set_fact:
|
||||
metallb_combined_values: "{{ metallb_default_values | combine(metallb_values, recursive=true) }}"
|
||||
|
||||
- name: Deploy MetalLB
|
||||
community.kubernetes.helm:
|
||||
create_namespace: true
|
||||
release_namespace: "{{ metallb_namespace | default('metallb-system') }}"
|
||||
release_name: "{{ metallb_name | default('metallb') }}"
|
||||
chart_ref: "{{ metallb_chart | default('bitnami/metallb') }}"
|
||||
chart_version: "{{ metallb_version | default(omit) }}"
|
||||
release_values: "{{ metallb_combined_values | from_yaml }}"
|
||||
wait: true
|
||||
|
||||
- name: Check for strict arp
|
||||
check_mode: false
|
||||
shell: |
|
||||
kubectl get configmap kube-proxy -n kube-system -o yaml | \
|
||||
sed -e "s/strictARP: false/strictARP: true/" | \
|
||||
kubectl diff -f - -n kube-system
|
||||
register: check_strict_arp
|
||||
when: strict_arp_for_metallb
|
||||
changed_when: check_strict_arp.rc != 0
|
||||
|
||||
- name: Apply strict arp
|
||||
shell: |
|
||||
kubectl get configmap kube-proxy -n kube-system -o yaml | \
|
||||
sed -e "s/strictARP: false/strictARP: true/" | \
|
||||
kubectl apply -f - -n kube-system \
|
||||
&& kubectl -n kube-system delete pods --selector=k8s-app=kube-proxy
|
||||
when:
|
||||
- strict_arp_for_metallb
|
||||
- check_strict_arp.changed
|
Reference in New Issue
Block a user