Skip to content

Commit 3c31b13

Browse files
authored
Merge pull request #612 from smortex/freebsd
Add support for FreeBSD
2 parents 91c32e2 + 237d7a0 commit 3c31b13

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

manifests/install.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
}
1616

1717
$pythondev = $facts['os']['family'] ? {
18-
'AIX' => "${python}-devel",
19-
'RedHat' => "${python}-devel",
20-
'Debian' => "${python}-dev",
21-
'Suse' => "${python}-devel",
22-
'Gentoo' => undef,
18+
'AIX' => "${python}-devel",
19+
'Debian' => "${python}-dev",
20+
'FreeBSD' => undef,
21+
'Gentoo' => undef,
22+
'RedHat' => "${python}-devel",
23+
'Suse' => "${python}-devel",
2324
}
2425

2526
$pip_ensure = $python::pip ? {
@@ -225,6 +226,10 @@
225226
$pip_category = undef
226227
$pip_package = 'python2-pip'
227228
$pip_provider = pip2
229+
} elsif $facts['os']['family'] == 'FreeBSD' {
230+
$pip_category = undef
231+
$pip_package = "py${python::version}-pip"
232+
$pip_provider = 'pip'
228233
} elsif $facts['os']['family'] == 'Gentoo' {
229234
$pip_category = 'dev-python'
230235
$pip_package = 'pip'

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
class python::params {
77
# Module compatibility check
8-
unless $facts['os']['family'] in ['Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX',] {
8+
unless $facts['os']['family'] in ['AIX', 'Debian', 'FreeBSD', 'Gentoo', 'RedHat', 'Suse'] {
99
fail("Module is not compatible with ${facts['os']['name']}")
1010
}
1111

metadata.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
"10"
3737
]
3838
},
39+
{
40+
"operatingsystem": "FreeBSD",
41+
"operatingsystemrelease": [
42+
"11",
43+
"12",
44+
"13"
45+
]
46+
},
3947
{
4048
"operatingsystem": "Gentoo"
4149
},

spec/defines/requirements_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
it { is_expected.to contain_package('gunicorn') }
5454
it { is_expected.to contain_file('/requirements.txt').with_owner('root').with_group('root') }
5555

56-
if facts[:os]['name'] == 'Gentoo'
56+
if %w[FreeBSD Gentoo].include?(facts[:os]['name'])
5757
it { is_expected.not_to contain_package('python-dev') }
5858
else
5959
it { is_expected.to contain_package('python-dev') }

0 commit comments

Comments
 (0)