blob: 174e4841b146222f35ed57a8168c3034ea5d76d8 [file] [log] [blame]
Fatih Degirmenciedec2152019-07-27 16:21:49 +00001---
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19
Fatih Degirmenciedec2152019-07-27 16:21:49 +000020- name: Ensure /home/{{ ansible_env.SUDO_USER }}/.kube folder exists and empty
21 file:
22 path: "/home/{{ ansible_env.SUDO_USER }}/.kube"
23 state: "{{ item }}"
24 owner: "{{ ansible_env.SUDO_USER }}"
25 mode: 0755
26 with_items:
27 - absent
28 - directory
29
30- name: Copy kubernetes admin.conf to /home/{{ ansible_env.SUDO_USER }}/.kube
31 copy:
32 src: "{{ engine_cache }}/repos/kubespray/inventory/engine/artifacts/admin.conf"
33 dest: "/home/{{ ansible_env.SUDO_USER }}/.kube/config"
34 owner: "{{ ansible_env.SUDO_USER }}"
35 mode: 0644
36
37- name: Download kubectl and place it to /usr/local/bin
38 get_url:
39 url: "{{ kubectl_download_url }}"
40 dest: /usr/local/bin/kubectl
41 owner: root
42 group: root
43 mode: 0755
44
45- name: Download helm client
46 unarchive:
47 src: "{{ helm_client_download_url }}"
Fatih Degirmenci87c986c2020-01-12 22:35:53 +000048 remote_src: true
Fatih Degirmenciedec2152019-07-27 16:21:49 +000049 dest: /tmp
50
51- name: Place helm and tiller binaries to /usr/local/bin
52 copy:
53 src: "/tmp/linux-amd64/{{ item }}"
Fatih Degirmenci87c986c2020-01-12 22:35:53 +000054 remote_src: true
Fatih Degirmenciedec2152019-07-27 16:21:49 +000055 dest: "/usr/local/bin/{{ item }}"
56 owner: root
57 group: root
58 mode: 0755
59 with_items:
60 - helm
61 - tiller
62
63- name: Delete temporary files and folders
64 file:
65 path: "{{ item }}"
66 state: absent
67 with_items:
68 - "/tmp/helm-{{ helm_version }}-linux-amd64.tar.gz"
69 - "/tmp/linux-amd64"
70
71# vim: set ts=2 sw=2 expandtab: