Openstack heat orchestration to have a Security Group on OpenStack using the heat template
--------------
- The YAML file for the security group is given below.
- Please note that this YAML file will implement a security group with the default egress rules as such.
- For having a security group with the rules also put in the security group as the security group is in implementation: please see the next post.
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]# cat 07securitygroup.yml
---
# for Newton release of OpenStack
#
heat_template_version: 2016-10-14
description: put a security group
resources:
securitygroup:
type: OS::Neutron::SecurityGroup
properties:
name: securitygroup1
outputs:
subnet_info:
value: { get_attr: [securitygroup]}
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]#
---
Create the security group using the stack
openstack stack create -t 07securitygroup.yml mysecuritygroup1
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]# openstack stack create -t 07securitygroup.yml mysecuritygroup1
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| id | a361b433-4bd4-458e-8c83-ad9299b20bdd |
| stack_name | mysecuritygroup1 |
| description | put a security group |
| creation_time | 2017-10-19T21:25:22Z |
| updated_time | None |
| stack_status | CREATE_IN_PROGRESS |
| stack_status_reason | Stack CREATE started |
+---------------------+--------------------------------------+
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]#
This shows the heat has the stack implementation
----
See the security group has been created
openstack security group list | grep -i securitygroup1
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]# openstack security group list | grep -i securitygroup1
| 8630ac7b-7fbb-45c7-a23e-f89d06804b62 | securitygroup1 | | 49b25ce4022c492fa0c1eab4fc6c7419 |
[root@newtonallinone HeatOrchestrationTemplates(keystone_admin)]#
No comments:
Post a Comment