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: Get Swift pass from file
17 shell: 'grep "export SWIFT_PASS=" /etc/swift/usr/admin/env_file | awk -F"=" "{ print \$2 }"'
18 register: swift_password_for_template
20 - name: Get Swift pass from file
21 shell: 'grep "export SWIFT_USER=" /etc/swift/usr/admin/env_file | awk -F"=" "{ print \$2 }"'
22 register: swift_user_for_template
24 - name: Get Swift pass from file
25 shell: 'grep "export SWIFT_TENANT=" /etc/swift/usr/admin/env_file | awk -F"=" "{ print \$2 }"'
26 register: swift_tenant_for_template
28 - name: template config files
30 src: "main/{{ item }}"
31 dest: "/etc/swift/main/{{ item }}"
32 owner: "{{ caas.uid.swift }}"
33 group: "{{ caas.uid.swift }}"
37 - container-server.conf
46 - name: Copy swift daemonset yaml
48 src: main/swift_main.yml
49 dest: "{{ caas.manifests_directory }}/swift_main.yml"
51 - name: Copy swift service yaml
53 src: main/swift_service.yml
54 dest: "{{ caas.manifests_directory }}/swift_service.yml"
56 - name: create Swift daemonset object
58 manifest: "{{ caas.manifests_directory }}/swift_main.yml"
60 when: ( nodename | search("caas_master1") )
62 - name: Create Swift service
64 manifest: "{{ caas.manifests_directory }}/swift_service.yml"
66 when: ( nodename | search("caas_master1") )
68 - name: wait for swift service to start
70 host: "{{ caas.swift_url }}"
71 port: "{{ caas.swift_port }}"