1 heat_template_version: 2013-05-23
\r
3 description: Heat template to deploy a FreeRadius
\r
6 # Metadata required by ONAP
\r
10 description: The VM name
\r
14 description: The VNF ID is provided by ONAP
\r
18 description: The VF Module ID is provided by ONAP
\r
20 # Server parameters, naming required by ONAP
\r
23 label: Image name or ID
\r
24 description: Image to be used for compute instance
\r
28 description: Type of instance (flavor) to be used
\r
32 description: Public key to be installed on the compute instance
\r
35 label: Public key name
\r
36 description: Public key name to be installed on the compute instance
\r
40 description: The VM name
\r
42 # Network parameters, naming required by ONAP
\r
43 onap_private_net_id:
\r
45 label: management network
\r
46 description: The management network
\r
47 onap_private_subnet_id:
\r
49 label: management network
\r
50 description: The management network
\r
53 label: control plane network
\r
54 description: The control plane network
\r
57 label: freeradius vm ip address
\r
58 description: freeradius vm ip address
\r
62 type: OS::Heat::RandomString
\r
67 type: OS::Nova::KeyPair
\r
69 name: { get_param: key_name }
\r
70 public_key: { get_param: pub_key }
\r
71 save_private_key: false
\r
73 freeRadius_oam_security_group:
\r
74 type: OS::Neutron::SecurityGroup
\r
76 description: security group
\r
79 template: pre_base_rand
\r
82 base: { get_param: vnf_name }
\r
83 rand: { get_resource: random-str }
\r
85 {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 22, port_range_max: 22},
\r
86 {remote_ip_prefix: 0.0.0.0/0, protocol: icmp}]
\r
88 freeRadius_control_plane_security_group:
\r
89 type: OS::Neutron::SecurityGroup
\r
91 description: security group
\r
94 template: pre_base_rand
\r
97 base: { get_param: vnf_name }
\r
98 rand: { get_resource: random-str }
\r
100 {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 22, port_range_max: 22},
\r
101 {remote_ip_prefix: 0.0.0.0/0, protocol: icmp}]
\r
103 freeRadius_0_oam_port_0:
\r
104 type: OS::Neutron::Port
\r
108 template: pre_base_rand
\r
111 base: { get_param: vnf_name }
\r
112 rand: { get_resource: random-str }
\r
113 network: { get_param: onap_private_net_id }
\r
114 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: freeradius_ip }}]
\r
115 security_groups: [{ get_resource: freeRadius_oam_security_group }]
\r
117 freeRadius_0_control_plane_port_0:
\r
118 type: OS::Neutron::Port
\r
122 template: pre_base_rand
\r
125 base: { get_param: vnf_name }
\r
126 rand: { get_resource: random-str }
\r
127 network: { get_param: public_net_id }
\r
128 security_groups: [{ get_resource: freeRadius_control_plane_security_group }]
\r
130 freeRadius_VM_settings:
\r
131 type: OS::Heat::SoftwareConfig
\r
136 apt-get install -y freeradius
\r
137 echo -e "password\npassword" | passwd cloud
\r
138 sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
\r
139 service ssh restart
\r
142 freeRadius_server_0:
\r
143 type: OS::Nova::Server
\r
145 image: { get_param: image_name }
\r
146 flavor: { get_param: flavor_name }
\r
147 name: { get_param: freeRadius_name_0 }
\r
148 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }, vnf_name: { get_param: vnf_name }}
\r
149 key_name: { get_resource: freeRadius_key }
\r
151 - port: { get_resource: freeRadius_0_oam_port_0 }
\r
152 - port: { get_resource: freeRadius_0_control_plane_port_0 }
\r
153 user_data_format: RAW
\r
156 echo "!!! Install FreeRadius"
\r
158 apt-get install -y freeradius
\r
159 echo "!!! Setup password authentication for user cloud"
\r
160 echo -e "password\npassword" | passwd cloud
\r
161 sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
\r
162 service ssh restart
\r