ansible-role-k8s-weave/tasks/main.yml
2019-10-01 13:47:02 +02:00

48 lines
1.1 KiB
YAML

- 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
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
tags: weave
# 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:
- psp.yaml.j2
- cluster-role-binding.yaml.j2
- cluster-role.yaml.j2
- sa.yaml.j2
- svc.yaml.j2
- ds.yaml.j2
- probe-deploy.yaml.j2
- deploy.yaml.j2
- weave_ingress.yaml.j2
tags: weave