Initial commit
[ta/infra-ansible.git] / roles / access-management / tasks / fill_sqls.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: Set fact for users
16   set_fact:
17     am_users:
18       - "{{ keystone_admin_user_name }}"
19   tags:
20     - am_dbfiller
21
22 - name: Set fact for users 2
23   set_fact:
24     am_users:
25       - keystone
26       - ironic
27       - restful
28       - "{{ keystone_admin_user_name }}"
29   when: '"controller" in hosts[installation_controller]["service_profiles"]'
30   tags:
31     - am_dbfiller
32
33 - name: Get UUID of users
34   run_once: true
35   keystone:
36     command: "get_user"
37     user_name: "{{ item }}"
38     endpoint: "{{ keystone_service_adminurl }}"
39     login_user: "{{ keystone_admin_user_name }}"
40     login_password: "{{ keystone_auth_admin_password }}"
41     login_project_name: "{{ keystone_admin_tenant_name }}"
42   with_items: "{{ am_users }}"
43   register: keystone_uuids
44   tags:
45     - am_dbfiller
46
47 - name: Create bash script to set service user special password policy options
48   template:
49     src: keystone_users_patch.sh.j2
50     dest: "{{ am_server_temp_dir }}/keystone_users_patch.sh"
51     owner: root
52     group: root
53     mode: 0500
54
55 - name: Run the bash script
56   run_once: true
57   shell: "{{ am_server_temp_dir }}/keystone_users_patch.sh >> {{ am_config.Logging.logdir }}/keystone_users_patch.log"