This commit is contained in:
parent
5d06225a9f
commit
c2564f783d
1 changed files with 3 additions and 1 deletions
|
|
@ -29,10 +29,12 @@
|
|||
- "{{ dashboard_files_list }}"
|
||||
- name: get the dashboard-token secret name
|
||||
ansible.builtin.command: kubectl --context {{ my_context }} get sa kubernetes-dashboard-traefik -n kubernetes-dashboard -o jsonpath='{.secrets[0].name}'
|
||||
changed_when: false
|
||||
register: secret_name
|
||||
|
||||
- name: get the sa token
|
||||
ansible.builtin.command: kubectl --context {{ my_context }} get secret -n kubernetes-dashboard {{ secret_name.stdout }} -o jsonpath='{.data.token}'
|
||||
changed_when: false
|
||||
register: token_value
|
||||
|
||||
- name: write the token to traefik v2 middleware
|
||||
|
|
@ -49,7 +51,7 @@
|
|||
spec:
|
||||
headers:
|
||||
customRequestHeaders:
|
||||
Authorization: "Bearer {{ token_value.stdout | b64decode }}"
|
||||
Authorization: "Bearer {{ token_value.stdout | b64decode }}"
|
||||
when:
|
||||
- traefik_version is defined
|
||||
- traefik_version | regex_search('(^2.)')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue