Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
servers-config
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Sistemisti
servers-config
Commits
d49f9cc1
Commit
d49f9cc1
authored
Mar 02, 2018
by
Pietro Albini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxd-container: expose ports on ipv4
parent
a9be0e38
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
playbooks/roadhouse.yml
playbooks/roadhouse.yml
+3
-0
roles/lxd-container/defaults/main.yml
roles/lxd-container/defaults/main.yml
+3
-0
roles/lxd-container/tasks/networking.yml
roles/lxd-container/tasks/networking.yml
+11
-0
roles/lxd-container/templates/firewall.sh.j2
roles/lxd-container/templates/firewall.sh.j2
+4
-0
No files found.
playbooks/roadhouse.yml
View file @
d49f9cc1
...
@@ -34,6 +34,9 @@
...
@@ -34,6 +34,9 @@
ip
:
10.0.0.2
ip
:
10.0.0.2
image
:
debian/jessie/amd64
image
:
debian/jessie/amd64
expose_ports
:
-
2222
-
role
:
lxd-container
-
role
:
lxd-container
name
:
bromuro
name
:
bromuro
...
...
roles/lxd-container/defaults/main.yml
0 → 100644
View file @
d49f9cc1
---
expose_ports
:
[]
roles/lxd-container/tasks/networking.yml
View file @
d49f9cc1
...
@@ -11,3 +11,14 @@
...
@@ -11,3 +11,14 @@
notify
:
notify
:
-
lxd.restart-bridge
-
lxd.restart-bridge
-
"
lxd-container.restart-{{
name
}}"
-
"
lxd-container.restart-{{
name
}}"
-
name
:
"
Expose
{{
name
}}
ports"
template
:
src
:
firewall.sh.j2
dest
:
"
/usr/local/share/firewall.d/lxd-container-{{
name
}}.sh"
mode
:
0700
when
:
expose_ports
notify
:
-
common.reload-firewall
roles/lxd-container/templates/firewall.sh.j2
0 → 100644
View file @
d49f9cc1
#!/bin/bash
{
%
for
port
in
expose_ports %
}
iptables
-t
nat
-A
PREROUTING
-p
tcp
-i
eth0
--dport
{{
port
}}
-j
DNAT
--to-destination
{{
ip
}}
:
{{
port
}}
{
% endfor %
}
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