def generate_test_client_openvpn_config
template = read_file! Path.find_file(:test_client_openvpn_template)
- config = Util.erb_eval(template, binding)
- write_file! :test_client_openvpn_config, config
+
+ ['production', 'testing', 'local'].each do |tag|
+ vpn_nodes = manager.nodes[:tags => tag][:services => 'openvpn']
+ if vpn_nodes.any?
+ config = Util.erb_eval(template, binding)
+ write_file! ('test_openvpn_'+tag).to_sym, config
+ end
+ end
end
end; end
# testing files
:test_client_key => 'test/cert/client.key',
:test_client_cert => 'test/cert/client.crt',
- :test_client_openvpn_config => 'test/openvpn/client.ovpn',
+ :test_openvpn_production => 'test/openvpn/production.ovpn',
+ :test_openvpn_testing => 'test/openvpn/testing.ovpn',
+ :test_openvpn_local => 'test/openvpn/local.ovpn',
:test_client_openvpn_template => 'test/openvpn/client.ovpn.erb'
}