-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
103 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Certificates parameters. | ||
default['mo_openvpn']['install_dir'] = '/etc/openvpn' | ||
|
||
default['mo_openvpn']['key']['country'] = 'AR' | ||
default['mo_openvpn']['key']['province'] = 'Buenos Aires' | ||
default['mo_openvpn']['key']['city'] = 'La Plata' | ||
default['mo_openvpn']['key']['org'] = 'My organization' | ||
default['mo_openvpn']['key']['ou'] = 'My organizational unit' | ||
default['mo_openvpn']['key']['email'] = 'user@domain' | ||
|
||
default['mo_openvpn']['ldap']['url'] = "ldap://ldap.domain" | ||
default['mo_openvpn']['ldap']['basedn'] = "ou=Usuarios,ou=myou,o=myorg" | ||
default['mo_openvpn']['ldap']['search_filter'] = "(uid=%u)" | ||
|
||
# Network configuration. | ||
default['mo_openvpn']['config']['server'] = '10.8.0.0 255.255.255.0' | ||
|
||
# Server specific | ||
# client 'push routes', attribute is treated as a helper | ||
default['mo_openvpn']['push_routes'] = [ "192.168.0.0 255.255.255.0" ] |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
name 'mo_openvpn' | ||
maintainer 'YOUR_NAME' | ||
maintainer_email 'YOUR_EMAIL' | ||
license 'All rights reserved' | ||
maintainer 'Christian A. Rodriguez & Leandro Di Tommaso' | ||
maintainer_email '[email protected] [email protected]' | ||
license 'MIT' | ||
description 'Installs/Configures mo_openvpn' | ||
long_description 'Installs/Configures mo_openvpn' | ||
version '0.1.0' | ||
|
||
depends 'apt', '~>2.7.0' |
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 |
---|---|---|
@@ -1,8 +1,25 @@ | ||
# | ||
# Cookbook Name:: mo_openvpn | ||
# Recipe:: default | ||
# | ||
# Copyright (C) 2015 YOUR_NAME | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
package 'openvpn' | ||
package 'openvpn-auth-ldap' | ||
|
||
template '/etc/openvpn/auth' do | ||
source 'auth.erb' | ||
owner 'root' | ||
group 'root' | ||
variables({ | ||
ldap_url: node['mo_openvpn']['ldap']['url'], | ||
ldap_basedn: node['mo_openvpn']['ldap']['basedn'], | ||
ldap_search_filter: node['mo_openvpn']['ldap']['search_filter'] | ||
}) | ||
end | ||
|
||
template '/etc/openvpn/server.conf' do | ||
source 'server.conf.erb' | ||
owner 'root' | ||
group 'root' | ||
variables({ | ||
server_network: node['mo_openvpn']['config']['server'], | ||
routes: node['mo_openvpn']['push_routes'], | ||
cert_filename: "#{node['fqdn']}.crt", | ||
key_filename: "#{node['fqdn']}.key" | ||
}) | ||
end |
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,12 @@ | ||
<LDAP> | ||
URL <%= @ldap_url %> | ||
Timeout 15 | ||
TLSEnable no | ||
FollowReferrals yes | ||
</LDAP> | ||
|
||
<Authorization> | ||
BaseDN <%= @ldap_base_dn %> | ||
SearchFilter <%= @ldap_search_filter %> | ||
RequireGroup false | ||
</Authorization> |
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,25 @@ | ||
port 1194 | ||
proto udp | ||
dev tun | ||
|
||
ca ca.crt | ||
cert <%= @cert_filename %> | ||
key <%= @key_filename %> | ||
dh dh2048.pem | ||
|
||
server <%= @server_network %> | ||
|
||
ifconfig-pool-persist ipp.txt | ||
|
||
<% @routes.each do |route| %> | ||
push "route <%= route %>" | ||
<% end %> | ||
|
||
keepalive 10 120 | ||
comp-lzo | ||
persist-key | ||
persist-tun | ||
verb 3 | ||
status openvpn-status.log | ||
|
||
plugin /usr/lib/openvpn/openvpn-auth-ldap.so /etc/openvpn/auth |