Merge "Add upload backend implementation"
[multicloud/k8s.git] / vagrant / playbooks / configure-istio.yml
1 ---
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 - hosts: localhost
12   become: yes
13   pre_tasks:
14     - name: Load krd variables
15       include_vars:
16         file: krd-vars.yml
17   roles:
18     - andrewrothstein.kubectl
19     - role: andrewrothstein.kubernetes-helm
20       kubernetes_helm_ver: v2.9.1
21   tasks:
22     - name: create istio folder
23       file:
24         state: directory
25         path: "{{ istio_dest }}"
26     - name: getting istio CRDs
27       block:
28       - name: download istio tarball
29         get_url:
30           url: "{{ istio_url }}"
31           dest: "/tmp/istio.tar.gz"
32       - name: extract istio source code
33         unarchive:
34           src: "/tmp/istio.tar.gz"
35           dest: "{{ istio_dest }}"
36           remote_src: yes
37       - name: copy istioctl binary to usr/local/bin folder
38         command: "mv {{ istio_dest }}/istio-{{ istio_version }}/bin/istioctl /usr/local/bin/"
39       when: istio_source_type == "tarball"
40     - name: create network objects
41       shell: "/usr/local/bin/kubectl apply -f {{ istio_dest }}/istio-{{ istio_version }}/install/kubernetes/helm/istio/templates/crds.yaml"
42     - name: render istio's core components
43       shell: "/usr/local/bin/helm template {{ istio_dest }}/istio-{{ istio_version }}/install/kubernetes/helm/istio --name istio --namespace istio-system > /tmp/istio.yaml"
44     - name: create istio manifest
45       shell: "/usr/local/bin/kubectl create namespace istio-system"
46       ignore_errors: True
47     - name: install the components via the manifest
48       shell: "/usr/local/bin/kubectl apply -f /tmp/istio.yaml"
49       ignore_errors: True