- name: Setup Traefik vars_files: - secrets/traefik_secrets.yaml hosts: - localhost tasks: - name: Create Traefik namespace delegate_to: localhost kubernetes.core.k8s: name: traefik api_version: v1 kind: Namespace state: present - name: Add Traefik chart repo delegate_to: localhost kubernetes.core.helm_repository: name: traefik repo_url: "https://traefik.github.io/charts" - name: Setup Traefik config map for OVH DNS delegate_to: localhost kubernetes.core.k8s: template: files/traefik_ovh_secret.template.yaml state: present # - name: Create PVC for Traefik data # delegate_to: localhost # kubernetes.core.k8s: # state: present # definition: # apiVersion: v1 # kind: PersistentVolumeClaim # metadata: # name: traefik-data # namespace: traefik # spec: # accessModes: # - ReadWriteOnce # resources: # requests: # storage: 1G - name: Setup Traefik delegate_to: localhost kubernetes.core.helm: name: traefik chart_ref: traefik/traefik update_repo_cache: true create_namespace: true release_namespace: traefik values: "{{ lookup('template', 'files/traefik_values.template.yaml') | from_yaml }}"