49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
---
|
|
- set_fact:
|
|
traefik_2_2_state: "present"
|
|
when:
|
|
- traefik_version | regex_search('(^2.)')
|
|
|
|
- set_fact:
|
|
traefik_2_2_state: "absent"
|
|
when:
|
|
- traefik_version | regex_search('(^1.)')
|
|
|
|
- name: traefik files version 2.2 need to be {{ traefik_2_2_state }}
|
|
k8s:
|
|
state: "{{ traefik_2_2_state }}"
|
|
context: "{{ my_context }}"
|
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
|
with_items:
|
|
- 2.2/traefik-crd-ingressroutes.yml.j2
|
|
- 2.2/traefik-crd-ingressroutetcps.yml.j2
|
|
- 2.2/traefik-crd-ingressrouteudps.yml.j2
|
|
- 2.2/traefik-crd-middlewares.yml.j2
|
|
- 2.2/traefik-crd-tlsoptions.yml.j2
|
|
- 2.2/traefik-crd-tlsstores.yml.j2
|
|
- 2.2/traefik-crd-traefikservices.yml.j2
|
|
- 2.2/traefik-cm.yml.j2
|
|
- 2.2/traefik-sa.yml.j2
|
|
- 2.2/traefik-clusterrole.yml.j2
|
|
- 2.2/traefik-clusterrolebinding.yml.j2
|
|
- 2.2/traefik-dp.yml.j2
|
|
- 2.2/traefik-svc.yml.j2
|
|
- 2.2/traefik-dashboard-svc.yml.j2
|
|
- 2.2/traefik-middleware-httpsredirect.yml.j2
|
|
- 2.2/traefik-middleware-basicauth.yml.j2
|
|
- 2.2/traefik-tls-options.yml.j2
|
|
- 2.2/traefik-dashboard.yml.j2
|
|
- 2.2/traefik-dashboard-insecure.yml.j2
|
|
- 2.2/traefik-ping.yml.j2
|
|
tags: traefik
|
|
|
|
- name: IP white list need to be {{ traefik_2_2_state }} for traefik version 2.2
|
|
k8s:
|
|
state: "{{ traefik_2_2_state }}"
|
|
context: "{{ my_context }}"
|
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
|
with_items:
|
|
- 2.2/traefik-middleware-ipwhitelist.yml.j2
|
|
when:
|
|
- ingress_whitelist is defined or traefik_2_2_state == "absent"
|
|
tags: traefik
|