Mercurial > repos > other > Puppet
diff modules/python/manifests/params.pp @ 387:66c075c5f54a
Update to newer Python module
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Jan 2022 17:13:06 +0000 |
parents | c42fb28cff86 |
children | adf6fe9bbc17 |
line wrap: on
line diff
--- a/modules/python/manifests/params.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/params.pp Mon Jan 03 17:13:06 2022 +0000 @@ -4,25 +4,31 @@ # The python Module default configuration settings. # class python::params { - $ensure = 'present' - $version = 'system' - $pip = 'present' - $dev = 'absent' - $virtualenv = 'absent' - $gunicorn = 'absent' - $manage_gunicorn = true - $provider = undef - $valid_versions = undef - $manage_scl = true + # Module compatibility check + unless $facts['os']['family'] in ['AIX', 'Debian', 'FreeBSD', 'Gentoo', 'RedHat', 'Suse'] { + fail("Module is not compatible with ${facts['os']['name']}") + } - if $facts['os']['family'] == 'RedHat' { - if $facts['os']['name'] != 'Fedora' { - $use_epel = true - } else { - $use_epel = false - } + $ensure = 'present' + $pip = 'present' + $dev = 'absent' + $virtualenv = 'absent' + $gunicorn = 'absent' + $manage_gunicorn = true + $manage_python_package = true + $manage_virtualenv_package = true + $manage_pip_package = true + $provider = undef + $valid_versions = undef + $manage_scl = true + $rhscl_use_public_repository = true + $anaconda_installer_url = 'https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh' + $anaconda_install_path = '/opt/python' + + if $facts['os']['family'] == 'RedHat' and $facts['os']['name'] != 'Fedora' { + $use_epel = true } else { - $use_epel = false + $use_epel = false } $group = $facts['os']['family'] ? { @@ -31,17 +37,15 @@ } $pip_lookup_path = $facts['os']['family'] ? { - 'AIX' => [ '/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/' ], - default => [ '/bin', '/usr/bin', '/usr/local/bin' ] + 'AIX' => ['/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/',], + default => ['/bin', '/usr/bin', '/usr/local/bin',] } $gunicorn_package_name = $facts['os']['family'] ? { - 'RedHat' => 'python-gunicorn', + 'RedHat' => $facts['os']['release']['major'] ? { + '8' => 'python3-gunicorn', + default => 'python-gunicorn', + }, default => 'gunicorn', } - - $rhscl_use_public_repository = true - - $anaconda_installer_url = 'https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh' - $anaconda_install_path = '/opt/python' }