forked from ngmaloney/chef-freeradius
-
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.
Add support to bind to ldap for freeradius. Also various fixes to mak…
…e this work for centos and ubuntu, changing packages, abstrating vairable. Also added some spec tests
- Loading branch information
1 parent
3cd16b3
commit 08b4467
Showing
14 changed files
with
1,497 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
freeradius CHANGELOG | ||
======================= | ||
|
||
This file is used to list changes made in each version of the freeradius cookbook. | ||
|
||
0.0.1 | ||
----- | ||
- [Nicholas Maloney] - Initial release of freeradius | ||
|
||
- - - | ||
|
||
1.0.0 | ||
----- | ||
- [Alex Farhadi] - Revamp of freeradius cookbook | ||
- Add support for LDAP | ||
- Add support for custom clients in freeradius | ||
- Change package defaults for centos/ubuntu | ||
- Abstract centos/ubuntu attributes | ||
- Add some chef spec tests | ||
- Update README for new LDAP documentation | ||
|
||
- - - |
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,7 @@ | ||
template "#{node['freeradius']['dir']}/modules/ldap" do | ||
source "ldap.erb" | ||
owner node['freeradius']['user'] | ||
group node['freeradius']['group'] | ||
mode 0600 | ||
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately | ||
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
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,83 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe 'freeradius::default' do | ||
let(:chef_run) do | ||
ChefSpec::Runner.new(platform: 'ubuntu', version: '12.04') do |node| | ||
node.set[:datacenter][:domain] = 'local' | ||
node.set[:freeradius][:clients] = { | ||
'localhost' => { | ||
'ipaddr' => '127.0.0.1', | ||
'netmask' => '0', | ||
'secret' => 'secret', | ||
'nastype' => 'other' | ||
}, | ||
'test' => { | ||
'ipaddr' => '10.0.0.0', | ||
'netmask' => '8', | ||
'secret' => 'secret', | ||
'nastype' => 'other' | ||
} | ||
} | ||
end.converge(described_recipe) | ||
end | ||
let(:chef_run_centos) do | ||
ChefSpec::Runner.new(platform: 'centos', version: '5.9') do |node| | ||
node.set[:datacenter][:domain] = 'local' | ||
node.set[:freeradius][:clients] = { | ||
'localhost' => { | ||
'ipaddr' => '127.0.0.1', | ||
'netmask' => '0', | ||
'secret' => 'secret', | ||
'nastype' => 'other' | ||
}, | ||
'test' => { | ||
'ipaddr' => '10.0.0.0', | ||
'netmask' => '8', | ||
'secret' => 'secret', | ||
'nastype' => 'other' | ||
} | ||
} | ||
end.converge(described_recipe) | ||
end | ||
|
||
it 'creates the client file' do | ||
template_content = <<HERE | ||
# -*- text -*- | ||
## | ||
## clients.conf -- client configuration directives | ||
## | ||
## $Id$ | ||
client localhost { | ||
ipaddr = 127.0.0.1 | ||
netmask = 0 | ||
secret = secret | ||
nastype = other | ||
} | ||
client test { | ||
ipaddr = 10.0.0.0 | ||
netmask = 8 | ||
secret = secret | ||
nastype = other | ||
} | ||
HERE | ||
expect(chef_run).to render_file("/etc/freeradius/clients.conf").with_content(template_content) | ||
end | ||
|
||
it 'installs freeradius' do | ||
expect(chef_run).to install_package('freeradius') | ||
end | ||
|
||
it 'installs freeradius on centos' do | ||
expect(chef_run_centos).to install_package('freeradius2') | ||
end | ||
|
||
it 'starts freeradius service ubuntu' do | ||
expect(chef_run).to start_service('freeradius') | ||
end | ||
|
||
it 'starts radiusd service centos' do | ||
expect(chef_run_centos).to start_service('radiusd') | ||
end | ||
|
||
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,25 @@ | ||
# Added by ChefSpec | ||
require 'chefspec' | ||
|
||
# Uncomment to use ChefSpec's Berkshelf extension | ||
# require 'chefspec/berkshelf' | ||
|
||
RSpec.configure do |config| | ||
# Specify the path for Chef Solo to find cookbooks | ||
# config.cookbook_path = '/var/cookbooks' | ||
|
||
# Specify the path for Chef Solo to find roles | ||
# config.role_path = '/var/roles' | ||
|
||
# Specify the Chef log_level (default: :warn) | ||
# config.log_level = :debug | ||
|
||
# Specify the path to a local JSON file with Ohai data | ||
# config.path = 'ohai.json' | ||
|
||
# Specify the operating platform to mock Ohai data from | ||
# config.platform = 'ubuntu' | ||
|
||
# Specify the operating version to mock Ohai data from | ||
# config.version = '12.04' | ||
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
Oops, something went wrong.