Update role
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adrien Reslinger 2020-06-07 00:16:29 +02:00
parent ec984ef8ad
commit 57d24a1ba3
5 changed files with 34 additions and 10 deletions

View file

@ -2,7 +2,21 @@
# Deploy Weave stack in kubernetes cluster with ansible # Deploy Weave stack in kubernetes cluster with ansible
This repo is deploy weave scope with ansible. This repo deploy weave net and weave scope with ansible.
## tags in role
- weave ( Deploy Net and Scope )
- weave-scope ( Deploy Scope )
- weave-net ( Deploy Net )
- k8s-network ( Deploy Net )
## Links
source scope: https://github.com/weaveworks/scope/tree/master/examples/k8s source scope: https://github.com/weaveworks/scope/tree/master/examples/k8s
source net: https://github.com/weaveworks/weave/tree/master/prog/weave-kube source net: https://github.com/weaveworks/weave/tree/master/prog/weave-kube

View file

@ -6,6 +6,7 @@ ingress_domain: "local.cluster"
# - 192.168.140.0/24 # - 192.168.140.0/24
basic_auth: false basic_auth: false
#traefik_version: "2.0" #traefik_version: "2.0"
traefik_namespace: tools #traefik_namespace: traefik
weave_net_password: "SuperMotDePasseDeLaMortQuiTue4012!"
scope_version: 1.13.0 scope_version: 1.13.0

View file

@ -1,6 +1,8 @@
--- ---
- name: Weave Net setup - name: Weave Net setup
block: block:
- name: Include Weave Net vars
include_vars: net-files.yaml
- name: Weave Net files - name: Weave Net files
k8s: k8s:
state: present state: present
@ -9,8 +11,6 @@
resource_definition: "{{ lookup('file', item) | from_yaml }}" resource_definition: "{{ lookup('file', item) | from_yaml }}"
with_items: with_items:
- "{{ weave_net_files }}" - "{{ weave_net_files }}"
when:
- kubernetes_network == "weave-net"
- name: Weave Net password - name: Weave Net password
k8s: k8s:
state: present state: present
@ -19,12 +19,17 @@
resource_definition: "{{ lookup('template', item) | from_yaml }}" resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items: with_items:
- weave-net-secret.yml.j2 - weave-net-secret.yml.j2
when: when:
- kubernetes_network == "weave-net" - kubernetes_network == "weave-net"
tags: weave tags:
- weave
- weave-net
- k8s-network
- name: Weave Scope setup - name: Weave Scope setup
block: block:
- name: Include Weave Scope vars
include_vars: scope-files.yaml
- name: namespace - name: namespace
k8s: k8s:
context: "{{ my_context }}" context: "{{ my_context }}"
@ -88,5 +93,8 @@
resource_definition: "{{ lookup('file', item) | from_yaml }}" resource_definition: "{{ lookup('file', item) | from_yaml }}"
with_items: with_items:
- "{{ weave_scope_files }}" - "{{ weave_scope_files }}"
tags: weave when:
- weave_scope|bool
tags:
- weave
- weave-scope

View file

@ -5,4 +5,4 @@ metadata:
namespace: kube-system namespace: kube-system
type: Opaque type: Opaque
data: data:
weave-passwd: {{ data | base64 }} weave-passwd: {{ weave_net_password | b64encode }}

View file

@ -1 +1,2 @@
user: "{{ ansible_user_id }}" user: "{{ ansible_user_id }}"
weave_scope: false