- debug: var=my_context tags: prom - name: Weave setup block: - name: namespace k8s: context: "{{ my_context }}" state: present name: weave api_version: v1 kind: Namespace - name: Create a Secret object for basic authentification (traefik 1.7) k8s: state: present context: "{{ my_context }}" definition: apiVersion: v1 kind: Secret metadata: name: basic-auth namespace: weave type: Opaque data: basic_auth: "{{ basic_auth_data | b64encode }}" when: - basic_auth == true - traefik_version is not defined or traefik_version | regex_search('(^1.)') tags: weave - name: Remove a Secret object for basic authentification (traefik 1.7) k8s: state: absent context: "{{ my_context }}" definition: apiVersion: v1 kind: Secret metadata: name: basic-auth namespace: weave type: Opaque data: basic_auth: "{{ basic_auth_data | b64encode }}" when: - traefik_version is defined - traefik_version | regex_search('(^2.)') tags: weave - name: Remove old existing Ingress object k8s: context: "{{ my_context }}" state: absent api_version: extensions/v1beta1 kind: Ingress namespace: weave name: weave when: - traefik_version is defined - traefik_version | regex_search('(^2.)') # file found https://github.com/weaveworks/scope/tree/master/examples/k8s/ - name: Weave Scope files k8s: state: present context: "{{ my_context }}" resource_definition: "{{ lookup('template', item) | from_yaml }}" with_items: - scope/psp.yaml.j2 - scope/cluster-role-binding.yaml.j2 - scope/cluster-role.yaml.j2 - scope/sa.yaml.j2 - scope/svc.yaml.j2 - scope/ds.yaml.j2 - scope/probe-deploy.yaml.j2 - scope/deploy.yaml.j2 - scope/weave_ingress.yaml.j2 tags: weave