Skip to content

Commit 9b38fdd

Browse files
add readme and example
1 parent 466d0ef commit 9b38fdd

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

roles/os_flavors/README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
OpenStack Flavors
22
=================
33

4-
This role can be used to register flavors in Nova using the
5-
`openstack.cloud.compute_flavor` module.
4+
This role can be used to register flavors in Nova and map them to projects
5+
using the `openstack.cloud.compute_flavor` module.
66

77
Requirements
88
------------
@@ -32,6 +32,15 @@ may contain 'ephemeral', 'flavorid', 'rxtx_factor' and 'swap' items.
3232
Optionally, the dict may also contain an item 'extra_specs', which is a dict of
3333
metadata to attach to the flavor object.
3434

35+
`is_public` is a mandatory parameter when mapping flavor to project. Non public
36+
flavor can't be mapped. However there is possibility to create flavor which
37+
is private and not mapped to any project. Only 'true' and 'false' are
38+
allowed here.
39+
40+
`project` list of project to which flavor should be mapped. In other
41+
words: this flavor will be visible and usable only in said project. It is
42+
a dict, withpossible one element.
43+
3544
Dependencies
3645
------------
3746

@@ -63,6 +72,25 @@ The following playbook registers a Nova flavor.
6372
hw:cpu_policy: "dedicated"
6473
hw:numa_nodes: "1"
6574

75+
The following playbook will allow uasge of `flavor-1` only in project `projectA`.
76+
77+
---
78+
- name: Map Nova flavors to projects
79+
hosts: localhost
80+
roles:
81+
- role: openstack.cloud.compute_flavor_access
82+
os_flavors_venv: "~/os-flavors-venv"
83+
os_flavors_auth_type: "password"
84+
os_flavors_auth:
85+
project_name: <keystone project>
86+
username: <keystone user>
87+
password: <keystone password>
88+
auth_url: <keystone auth URL>
89+
os_flavors:
90+
- name: flavor-1
91+
state: private
92+
project: "projectA"
93+
6694
Author Information
6795
------------------
6896

0 commit comments

Comments
 (0)