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: authenticate on swift
18 url: "{{ caas.swift }}/auth/v1.0"
20 X_Auth_User: admin:admin
21 X_Auth_Key: "{{ caas.swift_credential.password }}"
24 - name: clean charts list file if exists
26 path: /tmp/charts_list
29 - name: get current charts list
30 shell: "curl -H'X_Auth_Token: {{ auth.x_auth_token }}' {{ caas.swift }}/v1.0/AUTH_admin/packages > /tmp/charts_list"
34 chart_pattern: "{{ chart_name | replace('*', '.*') }}"
36 - name: version_pattern
38 version_pattern: "{{ chart_version | replace('*', '[0-9]+') }}"
41 shell: cat /tmp/charts_list | egrep "charts/{{ chart_pattern }}-[0-9]+\.[0-9]+\.[0-9]+" | egrep "{{ version_pattern }}\.tgz"
42 register: chart_matched
44 - name: delete the chart from swift
45 shell: "curl -XDELETE {{ caas.chart_repo }}/{{ item }}"
46 with_items: "{{ chart_matched.stdout_lines }}"
48 - name: helm repo update
49 shell: helm repo update default {{ caas.chart_repo }}/charts