Skip to content
Snippets Groups Projects
Commit 40f39b0f authored by matt01671's avatar matt01671
Browse files

cluster sg

parent f66639fc
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
- role: openstack-common
- role: openstack-volume
- role: openstack-security-group
- role: cluster-security-group
- role: openstack-instance
- hosts: instances
......@@ -27,3 +28,6 @@
roles:
- role: react-build
- hosts: dbs
\ No newline at end of file
......@@ -25,6 +25,13 @@ security_groups:
port_range_max: 80
remote_ip_prefix: 0.0.0.0/0
cluster_security_group:
- name: couchDB-cluster
description: "Security group for CouchDB cluster"
protocol: tcp
port_name_mix: 3306
port_name_max: 3306
# Instance
instances:
# - name: harvester
......
---
# Create a security group
- name: Create a security group
os_security_group:
name: '{{ item.name }}'
description: '{{ item.description }}'
state: present
loop: '{{ cluster_security_group }}'
- name: Create a list of security group names
set_fact:
sg_names: '{{ sg_names|default([]) + [ item.name ] }}'
loop: '{{ cluster_security_group }}'
- debug:
msg: "Security group(s) {{ sg_names }} have been created."
# Create security group rules
- name: Create security group rules
os_security_group_rule:
security_group: '{{ item.name }}'
protocol: '{{ item.protocol }}'
port_range_min: '{{ item.port_range_min }}'
port_range_max: '{{ item.port_range_max }}'
remote_group: '{{ sg_names }}'
state: present
loop: '{{ cluster_security_group }}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment