Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow override of global push settings #94

Merged
merged 1 commit into from
Aug 31, 2016

Conversation

devsibwarra
Copy link

We run multiple openvpn instances, some needing push_options that differ from the node[openvpn][push_options] value. This change allows overriding the global setting per-instance

Example

  openvpn_conf 'something' do
    action :create
    config ({
      'opt-verify' => '',
      'verb' => '4'
    })
    push_options ({
      'explicit-exit-notify' => '1',
      'route-gateway' => '10.8.0.1'
    })
  end

@flaccid flaccid self-assigned this Aug 31, 2016
@flaccid flaccid added this to the v3 milestone Aug 31, 2016
@flaccid flaccid merged commit 350e0db into sous-chefs:master Aug 31, 2016
@flaccid
Copy link
Contributor

flaccid commented Aug 31, 2016

@devsibwarra makes sense, thanks!

@devsibwarra
Copy link
Author

devsibwarra commented Aug 31, 2016

Looking deeper into the LWRP code, I think the variable type for push_routes/push_options can be an Array or Hash.

Thoughts? I can send a new PR for this quick fix

flaccid added a commit that referenced this pull request Aug 31, 2016
@flaccid
Copy link
Contributor

flaccid commented Sep 1, 2016

I noticed that too when I was reviewing; I think I was being a bit lazy due to being on holidays :)
Added a commit to make them Array. If you can find any issues, improvements or tests to add around this area, much appreciated.

@devsibwarra
Copy link
Author

The example in README.md uses an Array for push_routes and a Hash for push_options, so at the very least I'd suggest making the latter allow both ([Array,Hash])

@flaccid
Copy link
Contributor

flaccid commented Sep 4, 2016

It's actually an array of strings or hashes, the value depends on the directive you are setting and is relevant to how it is rendered (https://github.com/xhost-cookbooks/openvpn/blob/master/providers/conf.rb#L34-L51). The actual attribute is an array at that level. In the template, we do <% render_push_options(@push_options).each do |line| -%>.

@lock
Copy link

lock bot commented Jul 24, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants