Update for a fonctionnal deployment
This commit is contained in:
parent
9fa90d889e
commit
206f44c362
16 changed files with 90 additions and 22 deletions
|
|
@ -7,7 +7,7 @@
|
|||
k8s:
|
||||
state: present
|
||||
context: "{{ my_context }}"
|
||||
name: tools
|
||||
name: traefik
|
||||
api_version: v1
|
||||
kind: Namespace
|
||||
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
kind: Secret
|
||||
metadata:
|
||||
name: basic-auth
|
||||
namespace: tools
|
||||
namespace: traefik
|
||||
type: Opaque
|
||||
data:
|
||||
basic_auth: "{{ basic_auth_data | b64encode }}"
|
||||
|
|
@ -28,22 +28,39 @@
|
|||
- basic_auth == true
|
||||
tags: traefik
|
||||
|
||||
- name: Add host label for traefik deployment
|
||||
k8s:
|
||||
state: present
|
||||
context: "{{ my_context }}"
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Node
|
||||
metadata:
|
||||
name: "{{ item }}"
|
||||
labels:
|
||||
entrypoint: traefik
|
||||
with_items:
|
||||
- '{{ traefik_node_selector }}'
|
||||
when:
|
||||
- traefik_node_selector is defined
|
||||
tags: traefik
|
||||
|
||||
- name: Get Deployment information object
|
||||
k8s_facts:
|
||||
context: "{{ my_context }}"
|
||||
api_version: v1
|
||||
kind: Deployment
|
||||
name: traefik
|
||||
namespace: tools
|
||||
namespace: traefik
|
||||
field_selectors:
|
||||
- spec.template.spec.containers.image
|
||||
register: traefik_actual_resources
|
||||
|
||||
- name: Retreive actual traefik version
|
||||
shell: echo "{{ traefik_actual_resources.resources }}" | sed "s/.*traefik:v\([.0-9]*\).*/\1/" | uniq
|
||||
shell: echo "{{ traefik_actual_resources.resources }}" | sed "s/.*traefik:\([.0-9]*\).*/\1/" | uniq
|
||||
register: traefik_actual_version
|
||||
|
||||
- name: install / uninstall version 2.0
|
||||
include_tasks: "version_2.0.yml"
|
||||
when:
|
||||
- traefik_version == 2.0 or traefik_actual_version.stdout == 2.0
|
||||
- traefik_version == "2.0" or traefik_actual_version.stdout == "2.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue