Skip to content

Commit

Permalink
split out sql template into its own recipe, disable by default to mat…
Browse files Browse the repository at this point in the history
…ch ldap
  • Loading branch information
gleamicus committed Jun 22, 2015
1 parent f10b169 commit 13c78ab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
default['freeradius']['local_secret'] = "testing1234"
default['freeradius']['enable_remote_clients'] = true
default['freeradius']['remote_secret'] = "remote1234"
default['freeradius']['enable_sql'] = true
default['freeradius']['enable_sql'] = false

# Client File Config
default['freeradius']['clients'] = {
Expand Down
16 changes: 6 additions & 10 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,40 @@
include_recipe 'freeradius::ldap'
end

template "#{node['freeradius']['dir']}/sql.conf" do
source "sql.conf.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately
if node['freeradius']['enable_sql'] == true
include_recipe 'freeradius::sql'
end

template "#{node['freeradius']['dir']}/clients.conf" do
source "clients.conf.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately
notifies :restart, "service[#{node['freeradius']['service']}]"
end

template "#{node['freeradius']['dir']}/radiusd.conf" do
source "radiusd.conf.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately
notifies :restart, "service[#{node['freeradius']['service']}]"
end

template "#{node['freeradius']['dir']}/sites-available/default" do
source "default.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately
notifies :restart, "service[#{node['freeradius']['service']}]"
end

template "#{node['freeradius']['dir']}/sites-available/inner-tunnel" do
source "inner-tunnel.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]", :immediately
notifies :restart, "service[#{node['freeradius']['service']}]"
end

service node['freeradius']['service'] do
Expand Down
7 changes: 7 additions & 0 deletions recipes/sql.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
template "#{node['freeradius']['dir']}/sql.conf" do
source "sql.conf.erb"
owner node['freeradius']['user']
group node['freeradius']['group']
mode 0600
notifies :restart, "service[#{node['freeradius']['service']}]"
end

0 comments on commit 13c78ab

Please sign in to comment.