diff --git a/spec/defines/openvpn_client_spec.rb b/spec/defines/openvpn_client_spec.rb index 0aeffb3d..902fffb5 100644 --- a/spec/defines/openvpn_client_spec.rb +++ b/spec/defines/openvpn_client_spec.rb @@ -111,4 +111,10 @@ it { should contain_file('/etc/openvpn/test_server/download-configs/test_client/test_client.conf').with_content(/^sndbuf\s+393216$/)} it { should contain_file('/etc/openvpn/test_server/download-configs/test_client/test_client.conf').with_content(/^rcvbuf\s+393215$/)} end + + context "omitting the cipher key" do + let(:params) { { 'server' => 'test_server' } } + it { should_not contain_file('/etc/openvpn/test_server/download-configs/test_client/test_client.conf').with_content(/^cipher/) } + end + end diff --git a/templates/client.erb b/templates/client.erb index caf7ccf4..185d1bca 100644 --- a/templates/client.erb +++ b/templates/client.erb @@ -19,9 +19,9 @@ persist-key <% if @persist_tun -%> persist-tun <% end -%> -<% if @cipher -%> +<% if @cipher != '' -%> cipher <%= @cipher %> -<% end %> +<% end -%> <% if @mute_replay_warnings -%> mute-replay-warnings <% end -%>