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: The swift user is
17 shell: grep "export SWIFT_USER=" /etc/swift/usr/admin/env_file | awk -F"=" '{print($2) }'
20 - name: The swift tenant is
21 shell: grep "export SWIFT_TENANT=" /etc/swift/usr/admin/env_file | awk -F"=" '{print($2) }'
22 register: swift_tenant
24 - name: The swift pass is
25 shell: grep "export SWIFT_PASS=" /etc/swift/usr/admin/env_file | awk -F"=" '{print($2) }'
28 - name: Chart repo handler template
31 dest: "{{ caas.manifests_directory }}/chart-repo.yml"
33 - name: Chart repo service template
35 src: "chart-repo_service.yml"
36 dest: "{{ caas.manifests_directory }}/chart-repo_service.yml"
38 - name: Authenticate into swift
39 shell: 'curl -XGET -i -H"X-Auth-User:{{ swift_tenant.stdout }}:{{ swift_user.stdout }}" -H"X-Auth-Key:{{ swift_pass.stdout }}" {{ caas.swift }}/auth/v1.0 | grep X-Auth-Token: | awk "{ print \$2 }"'
40 register: SWIFT_AUTH_KEY
42 - name: Create packages folder/container into swift
43 shell: 'curl -XPUT -H"X-Auth-Token: {{ SWIFT_AUTH_KEY.stdout }}" {{ caas.swift }}/v1.0/AUTH_admin/packages'
45 - name: Read the swift main folder/container and check if is there the packages folder/conatiner
46 shell: 'curl -XGET -H"X-Auth-Token: {{ SWIFT_AUTH_KEY.stdout }}" {{ caas.swift }}/v1.0/AUTH_admin | grep packages'
48 - name: start chart repo handler
50 manifest: "{{ caas.manifests_directory }}/chart-repo.yml"
53 - name: start chart repo service
55 manifest: "{{ caas.manifests_directory }}/chart-repo_service.yml"