-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-gluster.yaml
55 lines (48 loc) · 1.65 KB
/
single-gluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
heat_template_version: 2014-10-16
description: |
Create a single gluster server with an attached volume.
resources:
# This key pair must already exist
existing_key_pair:
# http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Nova::KeyPair
type: OS::Nova::KeyPair
properties:
name: { get_param: public_key_name }
public_key: { get_param: public_key_value }
gluster_brick:
type: OS::Cinder::Volume
properties:
size: 75
gluster_server:
type: OS::Nova::Server
properties:
name: n-%index%
flavor: 1 GB General Purpose v1
image: CentOS 7 (PVHVM) (Orchestration)
user_data_format: RAW
user_data: |
#!/bin/bash -x
# Enable EPEL for dependencvies
yum -y install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# setup Gluster SIG repo
yum -y install centos-release-gluster38
# install gluster, samba
yum -y install glusterfs-server samba
# enable service
systemctl enable glusterd.service
# start service
systemctl start glusterd.service
# add open up ports on firewall
firewall-cmd --zone=public --add-port=24007-24008/tcp --permanent
# reload firewall rules
firewall-cmd --reload
volume_attachment_server1_brick1:
type: OS::Cinder::VolumeAttachment
properties:
volume_id: { get_resource: gluster_brick }
instance_uuid: { get_resource: gluster_server }
mountpoint: /dev/xvdc
outputs:
server_ip:
value:
get_attr: [gluster_server, accessIPv4]