Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Debian 11 support #414

Merged
merged 1 commit into from
Sep 18, 2021
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
value: debian9-64vpnserver.ma{hostname=vpnserver}-debian9-64vpnclienta.a{hostname=vpnclienta}
- name: Debian 10
value: debian10-64vpnserver.ma{hostname=vpnserver}-debian10-64vpnclienta.a{hostname=vpnclienta}
- name: Debian 11
value: debian11-64vpnserver.ma{hostname=vpnserver}-debian11-64vpnclienta.a{hostname=vpnclienta}
- name: Ubuntu 16.04
value: ubuntu1604-64vpnserver.ma{hostname=vpnserver}-ubuntu1604-64vpnclienta.a{hostname=vpnclienta}
- name: Ubuntu 18.04
Expand Down
2 changes: 2 additions & 0 deletions data/family/Debian/11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
openvpn::default_easyrsa_ver: '3.0'
2 changes: 1 addition & 1 deletion lib/facter/easyrsa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
binaryv3 = '/usr/share/easy-rsa/3/easyrsa'
when %r{Ubuntu|Debian}
case operatingsystemrelease
when %r{8|9|10|16.04|18.04|20.04}
when %r{8|9|10|11|16.04|18.04|20.04}
binaryv2 = '/usr/share/easy-rsa/pkitool'
binaryv3 = '/usr/share/easy-rsa/easyrsa'
else
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
"10"
"10",
"11"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/openvpn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
server_directory = '/etc/openvpn'
client_directory = '/etc/openvpn'
client_service = 'openvpn'
if fact('os.release.major') == '10' || fact('os.release.major') == '20.04'
if fact('os.release.major') =~ %r{10|11|20.04}
server_crt = "#{server_directory}/test_openvpn_server/easy-rsa/keys/issued/server.crt"
key_path = "#{server_directory}/test_openvpn_server/easy-rsa/keys/private"
crt_path = "#{server_directory}/test_openvpn_server/easy-rsa/keys/issued"
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/openvpn_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
it { is_expected.to create_class('openvpn') }
it { is_expected.to contain_class('openvpn::service') }
end
when 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04', 'CentOS-7', 'RedHat-7', 'CentOS-8', 'RedHat-8', 'Debian-9', 'Debian-10', %r{Archlinux}
else
let(:facts) do
facts.merge(
service_provider: 'systemd'
Expand Down
12 changes: 6 additions & 6 deletions spec/defines/openvpn_ca_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

# Execs to working with certificates

if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
it { is_expected.to contain_exec('generate dh param test_server').with_creates("#{server_directory}/test_server/easy-rsa/keys/dh.pem") }
else
it { is_expected.to contain_exec('generate dh param test_server').with_creates("#{server_directory}/test_server/easy-rsa/keys/dh2048.pem") }
Expand All @@ -125,7 +125,7 @@
it { is_expected.to contain_exec('create crl.pem on test_server') }
it { is_expected.not_to contain_exec('update crl.pem on test_server') }

if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_CA_EXPIRE=3650$}) }
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_CERT_EXPIRE=3650$}) }
it { is_expected.not_to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_REQ_CN"$}) }
Expand Down Expand Up @@ -159,7 +159,7 @@
}
end

if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_CA_EXPIRE=365$}) }
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_CERT_EXPIRE=365$}) }
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export EASYRSA_REQ_CN="yolo"$}) }
Expand All @@ -173,7 +173,7 @@
it { is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/vars").with_content(%r{^export KEY_OU="NSA"$}) }
end

if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
it { is_expected.to contain_exec('generate dh param test_server').with_creates("#{server_directory}/test_server/easy-rsa/keys/dh.pem") }
else
it { is_expected.to contain_exec('generate dh param test_server').with_creates("#{server_directory}/test_server/easy-rsa/keys/dh2048.pem") }
Expand All @@ -191,11 +191,11 @@
}
end

if facts[:os]['release']['major'] != '10' && facts[:os]['release']['major'] != '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
it {
is_expected.to contain_file("#{server_directory}/test_server/easy-rsa/openssl.cnf").with(
'ensure' => 'link',
'target' => "#{server_directory}/test_server/easy-rsa/openssl-1.0.0.cnf",
'target' => "#{server_directory}/test_server/easy-rsa/openssl-1.0.cnf",
'recurse' => nil,
'group' => 'nogroup'
)
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/openvpn_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

case facts[:os]['family']
when 'Ubuntu', 'Debian'
if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
context 'system with easyrsa3' do
it {
is_expected.to contain_file("#{server_directory}/test_server/download-configs/test_client/keys/test_client/test_client.crt").with(
Expand Down Expand Up @@ -260,7 +260,7 @@

case facts[:os]['family']
when 'Ubuntu', 'Debian'
if facts[:os]['release']['major'] == '10' || facts[:os]['release']['major'] == '20.04'
if facts[:os]['release']['major'] =~ %r{10|11|20.04}
context 'system with easyrsa3' do
it {
is_expected.to contain_file("#{server_directory}/test_server/download-configs/test_client/keys/test_client/test_client.crt").with(
Expand Down