Move swift authentication data to cm
[ta/caas-registry.git] / ansible / roles / swift / tasks / swift_main.yml
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: template config files
17   template:
18     src: "main/{{ item }}"
19     dest: "/etc/swift/main/{{ item }}"
20     owner: "{{ caas.uid.swift }}"
21     group: "{{ caas.uid.swift }}"
22     mode: 0640
23   with_items:
24     - account-server.conf
25     - container-server.conf
26     - object-server.conf
27     - proxy-server.conf
28     - swift.conf
29     - rsyncd.conf
30     - memcached
31     - nginx.conf
32   become_user: "root"
33
34 - name: Copy swift daemonset yaml
35   template:
36     src: main/swift_main.yml
37     dest: "{{ caas.manifests_directory }}/swift_main.yml"
38
39 - name:  Copy swift service yaml
40   template:
41     src: main/swift_service.yml
42     dest: "{{ caas.manifests_directory }}/swift_service.yml"
43
44 - name: create Swift daemonset object
45   kubectl:
46     manifest: "{{ caas.manifests_directory }}/swift_main.yml"
47     state: present
48   when: ( nodename | search("caas_master1") )
49
50 - name: Create Swift service
51   kubectl:
52     manifest: "{{ caas.manifests_directory }}/swift_service.yml"
53     state: present
54   when: ( nodename | search("caas_master1") )
55
56 - name: wait for swift service to start
57   wait_for:
58     host: "{{ caas.swift_url }}"
59     port: "{{ caas.swift_port }}"
60     state: started
61     timeout: 60