k8s/roles/traefik/tasks/helm.yml
mrwho c0dcdcfa5b refactor(traefik): restructure port configurations and fix condition logic
- uncomment and finalize port protocols and backend schemes in traefik.yml
- adjust longhorn UI basicauth to disabled for simplified access
- add reportdb-pgsql, salt-publish, and salt-request ports to traefik-values template
- fix conditional execution in helm task to prevent unintended skip
- fix uyuni database credentials by replacing dynamic password lookups with static values
- increase uyuni PVC storage requests from 1-20Mi to 300Mi for consistency
2026-07-21 16:27:01 +03:00

53 lines
1.8 KiB
YAML

---
- name: Helm | Add Traefik chart repository
ansible.builtin.command: helm repo add traefik https://traefik.github.io/charts
environment:
KUBECONFIG: "{{ traefik_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
register: _helm_repo_add
changed_when: "'already exists' not in _helm_repo_add.stdout"
failed_when: _helm_repo_add.rc != 0 and 'already exists' not in _helm_repo_add.stdout
- name: Helm | Update chart repositories
ansible.builtin.command: helm repo update
environment:
KUBECONFIG: "{{ traefik_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
changed_when: false
when: never is true | default(false)
- name: Helm | Render Traefik values
ansible.builtin.template:
src: traefik-values.yml.j2
dest: /tmp/traefik-values.yml
mode: "0600"
- name: Helm | Install or upgrade Traefik
ansible.builtin.command: >
helm upgrade --install traefik traefik/traefik
--namespace {{ traefik_namespace }}
--create-namespace
--version {{ traefik_chart_version }}
--values /tmp/traefik-values.yml
environment:
KUBECONFIG: "{{ traefik_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
register: _helm_install
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
- name: Helm | Force rollout restart to apply new hostPorts
ansible.builtin.command: >
kubectl rollout restart daemonset/traefik -n {{ traefik_namespace }}
environment:
KUBECONFIG: "{{ traefik_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
when: _helm_install.changed
- name: Helm | Wait for Traefik rollout to complete
ansible.builtin.command: >
kubectl rollout status daemonset/traefik -n {{ traefik_namespace }} --timeout=120s
environment:
KUBECONFIG: "{{ traefik_kubeconfig }}"
PATH: "/usr/local/bin:/usr/bin:/bin"
when: _helm_install.changed