Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.vagrant
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~

# Bundler
Gemfile.lock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure it's a good idea to gitignore this file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked up a boiler place .gitignore file from a different cookbook project. I was simply trying to avoid checking in the .kitchen folder/directory and Berksfile.lock since I don't think those files need to be committed. I can remove this file.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind ignoring it, but if we go this way we should remove the file from the repo first.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I guess if you remove it, it'll fix travis build

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll work on getting the build back in working order. I haven't had much time to look into it. Looks like just deleting the .lock file didn't work.

bin/*
.bundle/*

# test kitchen
.kitchen/
.kitchen.local.yml

# Chef
Berksfile.lock
.zero-knife.rb
Policyfile.lock.json
1 change: 0 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ provisioner:
platforms:
- name: centos-6.7
- name: centos-7.2
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-16.04

Expand Down
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata
cookbook 'yum'
cookbook 'chef-sugar', '~>3.0.1'
cookbook 'line'
cookbook 'python'
cookbook 'poise-python'
cookbook 'apt'

cookbook 'citadel',
Expand Down
245 changes: 0 additions & 245 deletions Gemfile.lock

This file was deleted.

12 changes: 5 additions & 7 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
case node['platform_family']
when 'debian'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-Ubuntu12.amd_64.deb'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.5-Ubuntu14.amd_64.deb'
case node['platform']
when 'ubuntu'
case node['platform_version'].split('.')[0]
when '12'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-Ubuntu12.amd_64.deb'
when '14'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-Ubuntu14.amd_64.deb'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.5-Ubuntu14.amd_64.deb'
when '16'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-Ubuntu16.amd_64.deb'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.5-Ubuntu16.amd_64.deb'
end
end
when 'rhel'
case node['platform_version'].split('.')[0]
when '6'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-CentOS6.x86_64.rpm'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.5-CentOS6.x86_64.rpm'
when '7'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.1.2-CentOS7.x86_64.rpm'
default['openvpnas']['url'] = 'http://swupdate.openvpn.org/as/openvpn-as-2.5-CentOS7.x86_64.rpm'
end
end

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
supports 'redhat'
supports 'ubuntu'

%w(apt yum chef-sugar line python citadel).each do |cookbook|
%w(apt yum chef-sugar line poise-python citadel).each do |cookbook|
depends cookbook
end
4 changes: 2 additions & 2 deletions recipes/backup.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_recipe 'python::default'
python_runtime '2.7'

python_pip 'awscli'
python_package 'awscli'

template '/usr/local/bin/openvpnas-backup' do
source 'openvpnas-backup.erb'
Expand Down
4 changes: 2 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
end

replace_or_add 'sa.company_name' do
path '/usr/local/openvpn_as/as.conf'
path '/usr/local/openvpn_as/etc/as.conf'
pattern 'sa.company_name=*'
line node['openvpnas']['company_name']

Expand All @@ -65,7 +65,7 @@
end

replace_or_add 'sa.logo_image_file' do
path '/usr/local/openvpn_as/as.conf'
path '/usr/local/openvpn_as/etc/as.conf'
pattern 'sa.logo_image_file=*'
line "sa.logo_image_file=#{node['openvpnas']['dir']}/logo.png"

Expand Down
4 changes: 2 additions & 2 deletions recipes/restore.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include_recipe 'python::default'
python_runtime '2.7'

python_pip 'awscli'
python_package 'awscli'

template '/usr/local/bin/openvpnas-restore' do
source 'openvpnas-restore.erb'
Expand Down
1 change: 0 additions & 1 deletion templates/default/openvpnas-backup.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ do
done
echo 'collecting extra files'
cp $OPENVPNAS_DIR/etc/as.conf $BACKUP_DIR
cp $OPENVPNAS_DIR/etc/config.json $BACKUP_DIR
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to remove this line ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that file is generated during the restore process. Latest openvpn backup/restore docs don't make reference to that file. https://docs.openvpn.net/configuration/migrating-an-access-server-installation/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

cp $OPENVPNAS_DIR/*.png $BACKUP_DIR

#archive all backuped up files
Expand Down
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

# as.conf files should has company_name
describe file('/usr/local/openvpn_as/as.conf') do
describe file('/usr/local/openvpn_as/etc/as.conf') do
it { should be_file }
its(:content) { should match(/.*company_name.*/) }
end
Expand Down