Update Helm to version 2.15.0
[ta/caas-helm.git] / ansible / roles / chart_repo / tasks / main.yaml
1 ---
2 # Copyright 2019 Nokia
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 - name: Chart repo handler template
17   template:
18     src: "chart-repo.yml"
19     dest: "{{ caas.manifests_directory }}/chart-repo.yml"
20
21 - name: Chart repo service template
22   template:
23     src: "chart-repo_service.yml"
24     dest: "{{ caas.manifests_directory }}/chart-repo_service.yml"
25
26 - name: Authenticate into swift
27   shell: 'curl -ifs -XGET -H"X-Auth-User:{{ caas.swift_credential.tenant }}:{{ caas.swift_credential.user }}" -H"X-Auth-Key:{{ caas.swift_credential.password }}" {{ caas.swift }}/auth/v1.0 | grep X-Auth-Token: | awk "{ print \$2 }"'
28   register: SWIFT_AUTH_KEY
29
30 - name: Create packages folder/container into swift
31   shell: 'curl -fs -XPUT -H"X-Auth-Token: {{ SWIFT_AUTH_KEY.stdout }}" {{ caas.swift }}/v1.0/AUTH_admin/packages'
32
33 - name: Read the swift main folder/container and check if is there the packages folder/conatiner
34   shell: 'curl -fs -XGET -H"X-Auth-Token: {{ SWIFT_AUTH_KEY.stdout }}" {{ caas.swift }}/v1.0/AUTH_admin | grep packages'
35
36 - name: start chart repo handler
37   kubectl:
38     manifest: "{{ caas.manifests_directory }}/chart-repo.yml"
39     state: present
40
41 - name: start chart repo service
42   kubectl:
43     manifest: "{{ caas.manifests_directory }}/chart-repo_service.yml"
44     state: present