Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Use a separate data directory for CCD files
Browse files Browse the repository at this point in the history
Fixes CCD files being ignored on 3541.x stemcells due to umask changes
  • Loading branch information
dpb587 committed Feb 13, 2018
1 parent 544d52c commit efd50e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ci/tasks/integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ source /tmp/local-bosh/director/env

bosh upload-stemcell \
--name=bosh-warden-boshlite-ubuntu-trusty-go_agent \
--version=3421.9 \
--sha1=1396d7877204e630b9e77ae680f492d26607461d \
https://s3.amazonaws.com/bosh-core-stemcells/warden/bosh-stemcell-3421.9-warden-boshlite-ubuntu-trusty-go_agent.tgz
--version=3541.2 \
--sha1=314b3144192db02f29e086ffbf928792ae3789fa \
https://s3.amazonaws.com/bosh-core-stemcells/warden/bosh-stemcell-3541.2-warden-boshlite-ubuntu-trusty-go_agent.tgz

export BOSH_DEPLOYMENT=integration-test

Expand Down
12 changes: 6 additions & 6 deletions jobs/openvpn/templates/bin/write-ccd.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

cd /var/vcap/jobs/openvpn/etc
[ ! -d /var/vcap/data/openvpn-ccd ] || rm -fr /var/vcap/data/openvpn-ccd

if [ -d ccd ] ; then
rm -fr ccd
fi
mkdir /var/vcap/data/openvpn-ccd
chmod 755 /var/vcap/data/openvpn-ccd

mkdir ccd
cd /var/vcap/data/openvpn-ccd

<% p('ccd').each do | ccd | %>
cat > ccd/<%= ccd[0] %> << EOF
cat > "<%= ccd[0] %>" << EOF
<%= ccd[1] %>
EOF
chmod 644 "<%= ccd[0] %>"
<% end %>
2 changes: 1 addition & 1 deletion jobs/openvpn/templates/etc/openvpn.conf.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mode server
writepid /var/vcap/sys/run/openvpn/openvpn.pid
client-config-dir /var/vcap/jobs/openvpn/etc/ccd
client-config-dir /var/vcap/data/openvpn-ccd
cipher <%= p('cipher') %>
keysize <%= p('keysize') %>
<% if_p('tls_cipher') do | v | %>
Expand Down
1 change: 1 addition & 0 deletions releases/openvpn/openvpn-4.2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* fix: client config directories cannot be used on stemcells v3541+

0 comments on commit efd50e6

Please sign in to comment.