sous-chefs / openvpn

Development repository for the openvpn cookbook
https://supermarket.chef.io/cookbooks/openvpn
Apache License 2.0
98 stars 160 forks source link

possible to allow to override the template file for `user client conf` #93

Closed chrisduong closed 7 years ago

chrisduong commented 8 years ago

Hi,

I have a need for adding one more config for our user client conf, called tls-auth 'ta.key' 1.

But it is not feasible to rewind Chef Resources, since the "user create code" lives inside a Search loop which yields different user id.

Is it possible if we can add cookbook attributes to the template file like this.

%w(conf ovpn).each do |ext|
      template "#{node['openvpn']['key_dir']}/#{node['openvpn']['client_prefix']}-#{u['id']}.#{ext}" do
        source 'client.conf.erb'
        cookbook node['openvpn']['client_template_cookbook']
        variables(client_cn: u['id'])
      end
    end
flaccid commented 8 years ago

That might be feasible. I'd be keen to see how a pull request for it might look (with documentation).

chrisduong commented 8 years ago

Hi,

Please take a look at PR #95

flaccid commented 7 years ago

Closing as PR #95 was merged.

lock[bot] commented 6 years ago

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.