Skip to content

Commit 4f05ba2

Browse files
committed
Add ServicePortal package.
1 parent 996bd62 commit 4f05ba2

File tree

10 files changed

+446
-0
lines changed

10 files changed

+446
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
f37aebd295e63a80bbc52501e0c9525e50db0849 forms.yaml
2+
604d60d4d4ac35b02a1d622160f060b32cbbe6d4 logo.jpg
3+
7625d71f8fbe6bff3f82aa1ecdee1216f967eaaf metadata.yaml
4+
de596534bff529414b1fd79b214ea54f2ef2311f site.yaml
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
create_site:
2+
- parameter: goc_portal_ip
3+
forms: CharField
4+
label: GOC Portal IP
5+
widget:
6+
forms: TextInput
7+
attrs:
8+
- class: form-control
9+
- required: required
10+
- parameter: goc_portal_tenant_id
11+
forms: CharField
12+
label: Tenant ID
13+
widget:
14+
forms: TextInput
15+
attrs:
16+
- class: form-control
17+
- required: required
18+
- parameter: goc_portal_tenant_admin_api_token
19+
forms: CharField
20+
label: Tenant Admin Token
21+
widget:
22+
forms: TextInput
23+
attrs:
24+
- class: form-control
25+
- required: required
26+
- parameter: goc_portal_tenant_name
27+
forms: CharField
28+
label: Tenant Name
29+
widget:
30+
forms: TextInput
31+
attrs:
32+
- class: form-control
33+
- required: required
34+
- parameter: goc_portal_tenant_admin_username
35+
forms: CharField
36+
label: Tenant Admin Name
37+
widget:
38+
forms: TextInput
39+
attrs:
40+
- class: form-control
41+
- required: required
42+
- parameter: goc_portal_tenant_admin_openstack_user_id
43+
forms: CharField
44+
label: Tenant Admin User ID
45+
widget:
46+
forms: TextInput
47+
attrs:
48+
- class: form-control
49+
- required: required
50+
- parameter: openstack_auth_url
51+
forms: CharField
52+
label: OS Auth URL
53+
widget:
54+
forms: TextInput
55+
attrs:
56+
- class: form-control
57+
- required: required
58+
- parameter: sportal_admin_account
59+
forms: CharField
60+
label: Service Portal Admin
61+
widget:
62+
forms: TextInput
63+
attrs:
64+
- class: form-control
65+
- required: required
66+
- parameter: sportal_admin_group_name
67+
forms: CharField
68+
label: Service Portal Group
69+
widget:
70+
forms: TextInput
71+
attrs:
72+
- class: form-control
73+
- required: required
74+
- parameter: sportal_admin_password
75+
forms: CharField
76+
label: Service Portal Admin Password
77+
widget:
78+
forms: TextInput
79+
attrs:
80+
- class: form-control
81+
- required: required
82+
- parameter: sportal_admin_email
83+
forms: CharField
84+
label: Service Portal Admin Email
85+
widget:
86+
forms: TextInput
87+
attrs:
88+
- class: form-control
89+
- required: required
51.1 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Solution name
2+
name: service_portal
3+
# Human-readable name for your solution
4+
title: ServicePortal
5+
# Solution version
6+
version: '1.0.0'
7+
# Description
8+
description: Service Portal is a GOC product that provide service user manage their cloud services.
9+
# Category
10+
category: Others
11+
# Required gemini version
12+
gemini_version: ['2016.4']
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
heat_template_version: '2014-10-16'
2+
3+
parameters:
4+
keypair:
5+
type: string
6+
constraints:
7+
- custom_constraint: nova.keypair
8+
goc_portal_ip:
9+
type: string
10+
default: '10.113.2.121'
11+
goc_portal_tenant_id:
12+
type: number
13+
default: 2
14+
goc_portal_tenant_admin_api_token:
15+
type: string
16+
default: 'fcae06c93fddb7a33d33428130ce1aac04cf1d32'
17+
goc_portal_tenant_name:
18+
type: string
19+
default: 'robert201630'
20+
goc_portal_tenant_admin_username:
21+
type: string
22+
default: '[email protected]'
23+
goc_portal_tenant_admin_openstack_user_id:
24+
type: string
25+
default: '87f0ddd4874740ff9a513620171110fd'
26+
openstack_auth_url:
27+
type: string
28+
default: 'http://10.113.1.2:5000/v2.0'
29+
sportal_admin_account:
30+
type: string
31+
default: 'admin'
32+
sportal_admin_group_name:
33+
type: string
34+
default: 'gemini'
35+
sportal_admin_password:
36+
type: string
37+
default: 'password'
38+
sportal_admin_email:
39+
type: string
40+
default: 'admin@gemini'
41+
42+
resources:
43+
service_portal_instance:
44+
type: OS::Nova::Server
45+
properties:
46+
flavor: '2cores4GBmemory40GBdisk'
47+
networks:
48+
- network: 'default_network'
49+
image: 'ServicePortal'
50+
key_name: {get_param: keypair}
51+
security_groups: [{ get_resource: service_portal_sg }]
52+
availability_zone: 'nova'
53+
user_data_format: RAW
54+
user_data:
55+
str_replace:
56+
template: |
57+
#!/bin/bash
58+
sed -i '/portal_ip/ c\portal_ip = "$GOC_PORTAL_IP"' /usr/share/sportal/sportal/configs.py
59+
sed -i '/tenant_id/ c\tenant_id = "$GOC_PORTAL_TENANT_ID"' /usr/share/sportal/sportal/configs.py
60+
sed -i '/tenant_admin_token/ c\tenant_admin_token = "$GOC_PORTAL_TENANT_ADMIN_API_TOKEN"' /usr/share/sportal/sportal/configs.py
61+
sed -i '/tenant_name/ c\tenant_name = "$GOC_PORTAL_TENANT_NAME"' /usr/share/sportal/sportal/configs.py
62+
sed -i '/tenant_admin_username/ c\tenant_admin_username = "$GOC_PORTAL_TENANT_ADMIN_USERNAME"' /usr/share/sportal/sportal/configs.py
63+
sed -i '/tenant_admin_openstack_user_id/ c\tenant_admin_openstack_user_id = "$GOC_PORTAL_TENANT_ADMIN_OPENSTACK_USER_ID"' /usr/share/sportal/sportal/configs.py
64+
sed -i '/openstack_auth_url/ c\openstack_auth_url = "$OPENSTACK_AUTH_URL"' /usr/share/sportal/sportal/configs.py
65+
sed -i '/ADMIN_ACCOUNT/ c\ADMIN_ACCOUNT = "$SPORTAL_ADMIN_ACCOUNT"' /usr/share/sportal/sportal/settings.py
66+
sed -i '/ADMIN_GROUP_NAME/ c\ADMIN_GROUP_NAME = "$SPORTAL_ADMIN_GROUP_NAME"' /usr/share/sportal/sportal/settings.py
67+
sed -i '/\<ADMIN_PASSWORD\>/ c\ADMIN_PASSWORD = "$SPORTAL_ADMIN_PASSWORD"' /usr/share/sportal/sportal/settings.py
68+
sed -i '/ADMIN_EMAIL/ c\ADMIN_EMAIL = "$SPORTAL_ADMIN_EMAIL"' /usr/share/sportal/sportal/settings.py
69+
sed -i '/\<ADMIN_USER_NAME\>/ c\ADMIN_USER_NAME = "$SPORTAL_ADMIN_ACCOUNT@$SPORTAL_ADMIN_GROUP_NAME"' /usr/share/sportal/sportal/settings.py
70+
cd /usr/share/sportal
71+
python init.py
72+
params:
73+
$GOC_PORTAL_IP: { get_param: goc_portal_ip }
74+
$GOC_PORTAL_TENANT_ID: { get_param: goc_portal_tenant_id }
75+
$GOC_PORTAL_TENANT_ADMIN_API_TOKEN: { get_param: goc_portal_tenant_admin_api_token }
76+
$GOC_PORTAL_TENANT_NAME: { get_param: goc_portal_tenant_name }
77+
$GOC_PORTAL_TENANT_ADMIN_USERNAME: { get_param: goc_portal_tenant_admin_username }
78+
$GOC_PORTAL_TENANT_ADMIN_OPENSTACK_USER_ID: { get_param: goc_portal_tenant_admin_openstack_user_id }
79+
$OPENSTACK_AUTH_URL: { get_param: openstack_auth_url }
80+
$SPORTAL_ADMIN_ACCOUNT: { get_param: sportal_admin_account }
81+
$SPORTAL_ADMIN_GROUP_NAME: { get_param: sportal_admin_group_name }
82+
$SPORTAL_ADMIN_PASSWORD: { get_param: sportal_admin_password }
83+
$SPORTAL_ADMIN_EMAIL: { get_param: sportal_admin_email }
84+
service_portal_ip_association:
85+
type: OS::Nova::FloatingIPAssociation
86+
properties:
87+
floating_ip: {get_resource: service_portal_floating_ip}
88+
server_id: {get_resource: service_portal_instance}
89+
service_portal_floating_ip:
90+
type: OS::Nova::FloatingIP
91+
properties:
92+
pool: 'net04_ext'
93+
service_portal_sg:
94+
type: OS::Neutron::SecurityGroup
95+
properties:
96+
description: firewall rules for Service Portal. 4505/4506 for salt.
97+
name:
98+
str_replace:
99+
template: $stack_name_service_portal_sg
100+
params:
101+
$stack_name: {get_param: "OS::stack_name"}
102+
rules: [
103+
{remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 22, port_range_max: 22},
104+
{remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 80, port_range_max: 80},
105+
{remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 443, port_range_max: 443},
106+
{remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 4505, port_range_max: 4506},
107+
{remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 8000, port_range_max: 8000},
108+
{remote_ip_prefix: 0.0.0.0/0, protocol: icmp}]
109+
110+
outputs:
111+
Service_Portal_url:
112+
description: Service Portal url
113+
value:
114+
str_replace:
115+
template: http://service_portal/
116+
params:
117+
service_portal: {get_attr: [service_portal_floating_ip, ip]}
118+
service_portal_group_info:
119+
description: Group Info
120+
value: {get_attr: [service_portal_instance, show]}

example/ServicePortal/forms.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
create_site:
2+
- parameter: goc_portal_ip
3+
forms: CharField
4+
label: GOC Portal IP
5+
widget:
6+
forms: TextInput
7+
attrs:
8+
- class: form-control
9+
- required: required
10+
- parameter: goc_portal_tenant_id
11+
forms: CharField
12+
label: Tenant ID
13+
widget:
14+
forms: TextInput
15+
attrs:
16+
- class: form-control
17+
- required: required
18+
- parameter: goc_portal_tenant_admin_api_token
19+
forms: CharField
20+
label: Tenant Admin Token
21+
widget:
22+
forms: TextInput
23+
attrs:
24+
- class: form-control
25+
- required: required
26+
- parameter: goc_portal_tenant_name
27+
forms: CharField
28+
label: Tenant Name
29+
widget:
30+
forms: TextInput
31+
attrs:
32+
- class: form-control
33+
- required: required
34+
- parameter: goc_portal_tenant_admin_username
35+
forms: CharField
36+
label: Tenant Admin Name
37+
widget:
38+
forms: TextInput
39+
attrs:
40+
- class: form-control
41+
- required: required
42+
- parameter: goc_portal_tenant_admin_openstack_user_id
43+
forms: CharField
44+
label: Tenant Admin User ID
45+
widget:
46+
forms: TextInput
47+
attrs:
48+
- class: form-control
49+
- required: required
50+
- parameter: openstack_auth_url
51+
forms: CharField
52+
label: OS Auth URL
53+
widget:
54+
forms: TextInput
55+
attrs:
56+
- class: form-control
57+
- required: required
58+
- parameter: sportal_admin_account
59+
forms: CharField
60+
label: Service Portal Admin
61+
widget:
62+
forms: TextInput
63+
attrs:
64+
- class: form-control
65+
- required: required
66+
- parameter: sportal_admin_group_name
67+
forms: CharField
68+
label: Service Portal Group
69+
widget:
70+
forms: TextInput
71+
attrs:
72+
- class: form-control
73+
- required: required
74+
- parameter: sportal_admin_password
75+
forms: CharField
76+
label: Service Portal Admin Password
77+
widget:
78+
forms: TextInput
79+
attrs:
80+
- class: form-control
81+
- required: required
82+
- parameter: sportal_admin_email
83+
forms: CharField
84+
label: Service Portal Admin Email
85+
widget:
86+
forms: TextInput
87+
attrs:
88+
- class: form-control
89+
- required: required

example/ServicePortal/logo.jpg

51.1 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Solution name
2+
name: service_portal
3+
# Human-readable name for your solution
4+
title: ServicePortal
5+
# Solution version
6+
version: '1.0.0'
7+
# Description
8+
description: Service Portal is a GOC product that provide service user manage their cloud services.
9+
# Category
10+
category: Others
11+
# Required gemini version
12+
gemini_version: ['2016.4']

0 commit comments

Comments
 (0)