Closed danielsand closed 9 years ago
found a work around
override[:openvpn][:config][:push] = "\"dhcp-option DNS 10.0.0.2\""
Are you sure you're looking at the right version of the source code? This is what I see in providers/conf.rb
:
action :create do
template "/etc/openvpn/#{new_resource.name}.conf" do
cookbook new_resource.cookbook
source "#{new_resource.name}.conf.erb"
owner 'root'
group 'root'
mode 0644
variables(
config: new_resource.config || node['openvpn']['config'],
push_routes: node['openvpn']['push_routes'],
push_options: node['openvpn']['push_options']
)
helpers do
# rubocop:disable Metrics/MethodLength
def render_push_options(push_options)
return [] if push_options.nil?
push_options.each_with_object([]) do |(option, conf), m|
case conf
when Chef::Node::ImmutableArray, Array
conf.each { |o| m << "push \"#{option} #{o}\"" }
when String
m << "push \"#{option} #{conf}\""
else
fail "Push option data type #{conf.class} not supported"
end
end
end
# rubocop:enable Metrics/MethodLength
end
end
end
And personally I'd recommend overriding that attribute with entirely strings instead of that sketchy :"string-with-dashes"
construct:
override['openvpn']['push_options']['dhcp-option']
you're right. i'm slightly confused why i have the old version pulled... sorry for the hassle and thanks for the input on the override attribute construct.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hey Folks,
it looks like specifying the push_options attribute doesnt trigger anything
when i look into templates/default/server.conf.erb - i dont see any handling inside neither
same is under providers/conf.rb
i see that variables are passed through node['openvpn']['config'] & node['openvpn']['push_routes'] but nowhere i find node['openvpn']['push_options']
maybe i'm blind - any hints ?