Skip to content

Commit 6cbf191

Browse files
authored
Merge pull request #25 from stackhpc/cloudkitty-role-config
Cloudkitty role config
2 parents f874110 + 71c5913 commit 6cbf191

File tree

6 files changed

+109
-1
lines changed

6 files changed

+109
-1
lines changed

ansible/group_vars/all/openstack

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,18 @@ openstack_host_aggregates: []
6262
# List of clusters templates in the openstack project. Format is as required by the
6363
# stackhpc.os-container-clusters role.
6464
openstack_container_clusters_templates: []
65+
66+
###############################################################################
67+
# Configuration variables for a CloudKitty ratings service deployment.
68+
69+
# A list where each item is a dictionary mapping the associated fields,
70+
# with the 'mappings' field also being a list of dictionaries.
71+
# Example of the mappings and their fields can be found below,
72+
# however for more information please refer to the README.md file.
73+
#
74+
openstack_ratings_hashmap_field_mappings: []
75+
76+
# Much like the field mappings above, the service mappings are a list of
77+
# dictionaries, however these are not associated with a field.
78+
#
79+
openstack_ratings_hashmap_service_mappings: []

ansible/openstack-ratings.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Generate OpenStack software ratings
3+
hosts: localhost
4+
tags:
5+
- ratings
6+
roles:
7+
- role: stackhpc.openstack.os_ratings
8+
os_ratings_hashmap_field_mappings: "{{ openstack_ratings_hashmap_field_mappings }}"
9+
os_ratings_hashmap_service_mappings: "{{ openstack_ratings_hashmap_service_mappings }}"
10+
os_ratings_venv: "{{ openstack_venv }}"

ansible/openstack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- import_playbook: openstack-images.yml
77
- import_playbook: openstack-host-aggregates.yml
88
- import_playbook: openstack-container-clusters.yml
9+
- import_playbook: openstack-ratings.yml

etc/openstack-config/openstack-config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,39 @@
9696
# Whether generated cluster templates should be public by default (defaults to 'True')
9797
# magnum_cluster_templates_public:
9898

99+
###############################################################################
100+
# Configuration variables for a CloudKitty ratings service deployment.
101+
102+
# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY
103+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE
104+
# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG.
105+
# # # # # # # MORE INFO CAN BE FOUND IN THE README.md
106+
# # ### # ##### 'stackhpc-kayobe-config' DOCS.
107+
108+
109+
# A list where each item is a dictionary mapping the associated fields,
110+
# with the 'mappings' field also being a list of dictionaries. Example
111+
# of the mappings and their fields can be found below, however for more
112+
# information please refer to the stackhpc.openstack.os_ratings role docs.
113+
#
114+
#openstack_ratings_hashmap_field_mappings:
115+
# - service: SERVICE_NAME
116+
# name: FIELD_NAME
117+
# mappings:
118+
# - value: MAPPING_VALUE
119+
# cost: MAPPING_COST
120+
# type: MAPPING_TYPE
121+
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
122+
123+
# Much like the field mappings above, the service mappings are a list of
124+
# dictionaries, however these are not associated with a field.
125+
#
126+
#openstack_ratings_hashmap_service_mappings:
127+
# - service: SERVICE_NAME
128+
# cost: MAPPING_COST
129+
# type: MAPPING_TYPE
130+
# group: MAPPING_GROUP <---THIS IS OPTIONAL---
131+
99132
###############################################################################
100133
# Dummy variable to allow Ansible to accept this file.
101134
workaround_ansible_issue_8743: yes

examples/ratings.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
###############################################################################
3+
# Configuration of CloudKitty for openstack.
4+
5+
# Example configuration for registering CloudKitty fields.
6+
# Included is mapping for various different compute flavors &
7+
# a service mapping based on the stored image size in Glance.
8+
9+
openstack_ratings_hashmap_field_mappings:
10+
- service: instance
11+
name: flavor_id
12+
mappings:
13+
- value: '1' #tiny compute flavour with an OpenStack flavor ID of 1
14+
cost: 1.0
15+
group: instance_uptime_flavor_id
16+
type: flat
17+
- value: '2' #small compute flavour with an OpenStack flavor ID of 2
18+
cost: 2.0
19+
group: instance_uptime_flavor_id
20+
type: flat
21+
- value: '3' #medium compute flavour with an OpenStack flavor ID of 3
22+
cost: 3.0
23+
group: instance_uptime_flavor_id
24+
type: flat
25+
- value: '4' #large compute flavour with an OpenStack flavor ID of 4
26+
cost: 4.0
27+
group: instance_uptime_flavor_id
28+
type: flat
29+
- value: '5' #xlarge compute flavour with an OpenStack flavor ID of 5
30+
cost: 5.0
31+
group: instance_uptime_flavor_id
32+
type: flat
33+
- value: '6' #tiny 2 compute flavour with an OpenStack flavor ID of 6
34+
cost: 2.0
35+
group: instance_uptime_flavor_id
36+
type: flat
37+
38+
openstack_ratings_hashmap_service_mappings:
39+
- service: image.size
40+
cost: 0.1
41+
group: image_size
42+
type: flat
43+
44+
# # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF
45+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE
46+
# # # # # # ### CONFIGURED CORRECTLY. MORE INFO CAN
47+
# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config'
48+
# # ### # ##### DOCS.
49+

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ collections:
33
- name: openstack.cloud
44
version: 2.1.0
55
- name: stackhpc.openstack
6-
version: 0.1.1
6+
version: 0.2.0

0 commit comments

Comments
 (0)