-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for OpenVPN bridged mode
- Loading branch information
1 parent
73956cf
commit 161a8f5
Showing
7 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
|
||
- name: Setup bridge | ||
when: openvpn_bridge | ||
template: | ||
src: bridge-interface.j2 | ||
dest: "/etc/network/interfaces.d/{{ openvpn_dev }}" | ||
register: bridge | ||
notify: [networking restart] | ||
tags: [bridge] | ||
|
||
- name: Restart networking | ||
service: name=networking state=restarted | ||
when: openvpn_bridge and bridge|changed | ||
tags: [bridge] | ||
|
||
- file: | ||
path: "/etc/network/interfaces.d/{{ openvpn_dev }}" | ||
state: absent | ||
when: not openvpn_bridge | ||
tags: [bridge] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# DO NOT EDIT THIS FILE BECAUSE IT IS AUTOMATICALLY GENERATED FROM ANSIBLE | ||
|
||
# OpenVPN interface | ||
auto {{ openvpn_dev }} | ||
iface {{ openvpn_dev }} inet manual | ||
pre-up openvpn --mktun --dev {{ openvpn_dev }} --dev-type tap | ||
post-down openvpn --rmtun --dev {{ openvpn_dev }} --dev-type tap | ||
up ifconfig $IFACE 0.0.0.0 up | ||
down ifconfig $IFACE down | ||
|
||
# Bridge | ||
auto br-{{ openvpn_dev }} | ||
iface br-{{ openvpn_dev }} inet static | ||
bridge_ports {{ openvpn_dev }} | ||
bridge_stp off | ||
address 10.27.253.1 | ||
netmask 255.255.255.0 | ||
network 10.27.253.0 | ||
broadcast 10.27.253.255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters