Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
17
Merge Requests
1
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
940d56d9
authored
Aug 26, 2015
by
Czémán Arnold
Committed by
cloud
Feb 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fwdriver: open necessary ports for head machine installing
parent
363c00ff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
0 deletions
+105
-0
pillar/installer.sls
+1
-0
pillar/ports.sls
+61
-0
pillar/top.sls
+1
-0
salt/fwdriver/files/open_ports.sh
+32
-0
salt/fwdriver/init.sls
+10
-0
No files found.
pillar/installer.sls
View file @
940d56d9
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#fwdriver:
#fwdriver:
# queue_name: cloud-6801
# queue_name: cloud-6801
# open_ports: False
# gateway: 10.0.255.254
# gateway: 10.0.255.254
# external_net: 10.0.0.115/16
# external_net: 10.0.0.115/16
# external_if: eth0
# external_if: eth0
...
...
pillar/ports.sls
0 → 100644
View file @
940d56d9
rabbitmq_ports:
-
port: 5672
proto: tcp
libvirt_ports:
-
range:
- 49152
- 49215
proto: tcp
-
port: 16509
proto: tcp
nfs_server_ports:
-
port: 2049
proto: tcp
-
port: 2049
proto: udp
-
port: 111
proto: tcp
-
port: 111
proto: udp
-
port: 20048
proto: tcp
-
port: 20048
proto: udp
-
port: 33100
proto: tcp
-
port: 33100
proto: udp
-
port: 32803
proto: tcp
-
port: 32769
proto: udp
pillar/top.sls
View file @
940d56d9
...
@@ -12,3 +12,4 @@ base:
...
@@ -12,3 +12,4 @@ base:
- manager
- manager
- common
- common
- installer
- installer
- ports
salt/fwdriver/files/open_ports.sh
0 → 100644
View file @
940d56d9
#!/bin/bash
{
% macro open_ports
(
port_list
)
-%
}
{
%
for
item
in
port_list %
}
$ADDRULE
\
{
%
if
'range'
in
item.keys
()
-%
}
--port-range
{{
item.range[0]
}}
{{
item.range[1]
}}
\
\{
%
else
%
}
\
--port
{{
item.port
}}
\
{
%- endif %
}
--protocol
{{
item.proto
}}
\
--firewall
{{
pillar[
'fwdriver'
][
'queue_name'
]
}}
\
--vlan-group
net
\
--owner
{{
pillar[
'admin_user'
]
}}
{
% endfor %
}
{
%- endmacro %
}
source
/home/
{{
pillar[
'user'
]
}}
/.virtualenvs/circle/bin/activate
source
/home/
{{
pillar[
'user'
]
}}
/.virtualenvs/circle/bin/postactivate
ADDRULE
=
"python /home/{{ pillar['user'] }}/circle/circle/manage.py add_rule"
# RabbitMQ ports
{{
open_ports
(
pillar[
'rabbitmq_ports'
])
}}
# libvirt ports
{{
open_ports
(
pillar[
'libvirt_ports'
])
}}
# NFS server ports
{{
open_ports
(
pillar[
'nfs_server_ports'
])
}}
salt/fwdriver/init.sls
View file @
940d56d9
...
@@ -59,3 +59,13 @@ firewall-init:
...
@@ -59,3 +59,13 @@ firewall-init:
service:
service:
- enabled
- enabled
{# TODO: standalone firewall mode #}
{% if pillar['fwdriver']['open_ports'] %}
salt://fwdriver/files/open_ports.sh:
cmd.script:
- template: jinja
- user: {{ pillar['user'] }}
- require:
- service: firewall
{% endif %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment