blob: 3552861df9c5f1bbae227ace8aab6014d5be17b6 [file] [log] [blame]
Matteo Scandolof0441032017-08-08 13:05:26 -07001
2# Copyright 2017-present Open Networking Foundation
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
Scott Bakerb63ea792016-08-11 10:24:48 -070017---
18- hosts: 127.0.0.1
19 connection: local
20 tasks:
Zack Williams9cb1f3a2017-08-20 19:35:03 -070021
22 - name: Create XOS slice (OpenStack project)
23 os_project:
24 auth:
25 auth_url: "{{ endpoint }}"
26 username: "{{ admin_user }}"
27 password: "{{ admin_password }}"
28 project_name: "{{ admin_project }}"
29 name: "{{ project }}"
30{% if delete %}
31 state: absent
32{% else %}
33 description: "{{ project_description }}"
34
35{% for role in roles %}
36 - name: Create role "{{ role }}"
37 os_keystone_role:
38 auth:
39 auth_url: "{{ endpoint }}"
40 username: "{{ admin_user }}"
41 password: "{{ admin_password }}"
42 project_name: "{{ admin_project }}"
43 name: "{{ role }}"
44
45 - name: Create users with roles in slice
46 os_user_role:
47 auth:
48 auth_url: "{{ endpoint }}"
49 username: "{{ admin_user }}"
50 password: "{{ admin_password }}"
51 project_name: "{{ admin_project }}"
52 user: "{{ username }}"
53 role: "{{ role }}"
54 project: "{{ project }}"
55
56{% endfor %}
57{% endif %}
58