diff --git a/manifests/install.pp b/manifests/install.pp index 64f9350e..4645bdcb 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -15,11 +15,12 @@ } $pythondev = $facts['os']['family'] ? { - 'AIX' => "${python}-devel", - 'RedHat' => "${python}-devel", - 'Debian' => "${python}-dev", - 'Suse' => "${python}-devel", - 'Gentoo' => undef, + 'AIX' => "${python}-devel", + 'Debian' => "${python}-dev", + 'FreeBSD' => undef, + 'Gentoo' => undef, + 'RedHat' => "${python}-devel", + 'Suse' => "${python}-devel", } $pip_ensure = $python::pip ? { @@ -225,6 +226,10 @@ $pip_category = undef $pip_package = 'python2-pip' $pip_provider = pip2 + } elsif $facts['os']['family'] == 'FreeBSD' { + $pip_category = undef + $pip_package = "py${python::version}-pip" + $pip_provider = 'pip' } elsif $facts['os']['family'] == 'Gentoo' { $pip_category = 'dev-python' $pip_package = 'pip' diff --git a/manifests/params.pp b/manifests/params.pp index e1ed7c21..32f13a72 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,7 @@ # class python::params { # Module compatibility check - unless $facts['os']['family'] in ['Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX',] { + unless $facts['os']['family'] in ['AIX', 'Debian', 'FreeBSD', 'Gentoo', 'RedHat', 'Suse'] { fail("Module is not compatible with ${facts['os']['name']}") } diff --git a/metadata.json b/metadata.json index 9bba9594..a139041d 100644 --- a/metadata.json +++ b/metadata.json @@ -36,6 +36,14 @@ "10" ] }, + { + "operatingsystem": "FreeBSD", + "operatingsystemrelease": [ + "11", + "12", + "13" + ] + }, { "operatingsystem": "Gentoo" }, diff --git a/spec/defines/requirements_spec.rb b/spec/defines/requirements_spec.rb index 17db0595..4e659b79 100644 --- a/spec/defines/requirements_spec.rb +++ b/spec/defines/requirements_spec.rb @@ -53,7 +53,7 @@ it { is_expected.to contain_package('gunicorn') } it { is_expected.to contain_file('/requirements.txt').with_owner('root').with_group('root') } - if facts[:os]['name'] == 'Gentoo' + if %w[FreeBSD Gentoo].include?(facts[:os]['name']) it { is_expected.not_to contain_package('python-dev') } else it { is_expected.to contain_package('python-dev') }