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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 - name: pause to wait for swift-update to be ready
20 - name: authenticate on swift-upgrade
22 url: "{{ caas.swift_update }}/auth/v1.0"
24 X_Auth_User: admin:admin
25 X_Auth_Key: "{{ caas.swift_credential.password }}"
30 url: "{{ caas.swift_update }}/v1.0/AUTH_admin/packages"
33 X_Auth_Token: "{{ auth.x_auth_token }}"
36 - name: get charts from packages
38 charts: "{{ (packages.get('content','')|trim).split('\n') | select('search', 'charts.+\\.tgz') | list }}"
40 - name: get value files from packages
42 value_files: "{{ (packages.get('content','')|trim).split('\n') | select('search', 'releases.+\\.yaml') | list }}"
45 - name: create chart directory
50 - name: download charts
53 command: "curl -O -XGET -H'X-Auth-Token: {{ auth.x_auth_token }}' {{ caas.swift_update }}/v1.0/AUTH_admin/packages/{{ item }}"
54 with_items: "{{ charts }}"
56 - name: download value files
59 command: "curl -O -XGET -H'X-Auth-Token: {{ auth.x_auth_token }}' {{ caas.swift_update }}/v1.0/AUTH_admin/packages/{{ item }}"
60 with_items: "{{ value_files }}"
63 - name: upload charts via chart-repo
66 shell: "curl -sS -XPOST --cacert /etc/chart-repo/ssl/ca.pem --cert /etc/chart-repo/ssl/chart-repo?.pem --key /etc/chart-repo/ssl/chart-repo?-key.pem -H 'Content-Type: application/gzip' --data-binary @{{ item | basename }} {{ caas.chart_repo }}/{{ item }}"
67 with_items: "{{ charts }}"
69 - name: helm repo update
70 shell: helm repo update default {{ caas.chart_repo }}/charts
72 - name: authenticate on swift
74 url: "{{ caas.swift }}/auth/v1.0"
76 X_Auth_User: admin:admin
77 X_Auth_Key: "{{ caas.swift_credential.password }}"
81 - name: upload value file via swift
84 shell: "curl -XPUT -H 'X-Auth-Token: {{ auth_orig.x_auth_token }}' -T {{ item | basename }} {{ caas.swift }}/v1.0/AUTH_admin/packages/{{ item }}"
85 with_items: "{{ value_files }}"