Skip to content

Commit

Permalink
Added remote atttibute for multiple addresses on one server
Browse files Browse the repository at this point in the history
  • Loading branch information
vitkhab committed Sep 12, 2016
1 parent 5348c76 commit 93a328f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
## 0.0.6 (Sep 12, 2016)
* New "remote" attribute for multiple servers in client config

## 0.0.4 (Sep 24, 2015)
* add --force option for user certificate revokation
2 changes: 1 addition & 1 deletion knife-openvpn.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)

Gem::Specification.new do |gem|
gem.name = 'knife-openvpn'
gem.version = '0.0.5'
gem.version = '0.0.6'
gem.summary = 'A knife plugin for Express 42 openvpn cookbook'
gem.description = gem.summary
gem.authors = ['LLC Express 42']
Expand Down
10 changes: 8 additions & 2 deletions lib/chef/knife/openvpn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,14 @@ def generate_client_config(server_name, user_name)
config_content << "dev #{config['dev']}" << newline
config_content << "proto #{config['proto']}" << newline
search_result.each do |result|
config_content << "remote #{result['openvpn'][server_name]['remote_host']} "
config_content << config['port'].to_s << newline
if result['openvpn'][server_name]['remote'].nil?
config_content << "remote #{result['openvpn'][server_name]['remote_host']} "
config_content << config['port'].to_s << newline
else
result['openvpn'][server_name]['remote'].each do |remote|
config_content << "remote #{remote}" << newline
end
end
end
config_content << "verb #{config['verb']}" << newline
config_content << 'comp-lzo' << newline
Expand Down

0 comments on commit 93a328f

Please sign in to comment.