Initial commit
[ta/infra-ansible.git] / roles / access-management / tasks / dbfiller.yaml
1 # Copyright 2019 Nokia
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 - name: Create AM values json file
16   template:
17     src: db_am_values.json.j2
18     dest: "{{ am_server_values_dir }}/db_am_values.json"
19
20 - name: Create service values json file
21   template:
22     src: db_service_values.json.j2
23     dest: "{{ am_server_values_dir }}/db_service_values.json"
24
25 - name: Copy private key to temp location
26   copy:
27     src: templates/am_pri_key.pem
28     dest: "{{ am_server_temp_dir }}"
29
30 - name: Create DB filler python script
31   template:
32     src: dbfiller.py.j2
33     dest: "{{ am_server_temp_dir }}/dbfiller.py"
34
35 - name: DB filler log file creation and rights set
36   file:
37     path: "{{ am_config.Logging.logdir }}/dbfiller.log"
38     owner: access-manager
39     group: access-manager
40     mode: 0660
41     state: touch
42
43 - name: Run the DB filler python script
44   run_once: true
45   shell: "python {{ am_server_temp_dir }}/dbfiller.py >> {{ am_config.Logging.logdir }}/dbfiller.log"