diff --git a/manifests/init.pp b/manifests/init.pp index 7ac93c0b..4d946ebc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -67,7 +67,7 @@ } # Module compatibility check - $compatible = [ 'Debian', 'RedHat', 'Suse', 'Gentoo' ] + $compatible = [ 'Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX' ] if ! ($facts['os']['family'] in $compatible) { fail("Module is not compatible with ${::operatingsystem}") } diff --git a/manifests/install.pp b/manifests/install.pp index e7b52347..88109484 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -6,13 +6,15 @@ # class python::install { - $python = $::python::version ? { + $python_version = getparam(Class['python'], 'version') + $python = $python_version ? { 'system' => 'python', 'pypy' => 'pypy', - default => "${python::version}", # lint:ignore:only_variable_string + default => "${python_version}", # lint:ignore:only_variable_string } - $pythondev = $::osfamily ? { + $pythondev = $facts['os']['family'] ? { + 'AIX' => "${python}-devel", 'RedHat' => "${python}-devel", 'Debian' => "${python}-dev", 'Suse' => "${python}-devel", @@ -177,17 +179,42 @@ } } default: { + case $facts['os']['family'] { + 'AIX': { + if "${python_version}" =~ /^python3/ { #lint:ignore:only_variable_string + class { 'python::pip::bootstap': + version => 'pip3', + } + } else { + package { 'python-pip': + ensure => $pip_ensure, + require => Package['python'], + provider => 'yum', + } + } + if $pythondev { + package { 'python-dev': + ensure => $dev_ensure, + name => $pythondev, + alias => $pythondev, + provider => 'yum', + } + } - package { 'pip': - ensure => $pip_ensure, - require => Package['python'], - } + } + default: { + package { 'pip': + ensure => $pip_ensure, + require => Package['python'], + } + if $pythondev { + package { 'python-dev': + ensure => $dev_ensure, + name => $pythondev, + alias => $pythondev, + } + } - if $pythondev { - package { 'python-dev': - ensure => $dev_ensure, - name => $pythondev, - alias => $pythondev, } } diff --git a/manifests/params.pp b/manifests/params.pp index b0e095e5..e028dc21 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,6 +1,8 @@ # @api private # @summary The python Module default configuration settings. # +# The python Module default configuration settings. +# class python::params { $ensure = 'present' $version = 'system' @@ -14,6 +16,7 @@ 'RedHat' => ['3','27','33'], 'Debian' => ['3', '3.3', '2.7'], 'Suse' => [], + 'AIX' => ['python3'], 'Gentoo' => ['2.7', '3.3', '3.4', '3.5'] } @@ -27,12 +30,17 @@ $use_epel = false } + $group = $facts['os']['family'] ? { + 'AIX' => 'system', + default => 'root' + } + $pip_lookup_path = $facts['os']['family'] ? { 'AIX' => [ '/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/' ], default => [ '/bin', '/usr/bin', '/usr/local/bin' ] } - $gunicorn_package_name = $::osfamily ? { + $gunicorn_package_name = $facts['os']['family'] ? { 'RedHat' => 'python-gunicorn', default => 'gunicorn', } diff --git a/manifests/pip.pp b/manifests/pip.pp index 1ac36773..e2ab11c6 100644 --- a/manifests/pip.pp +++ b/manifests/pip.pp @@ -1,5 +1,3 @@ - -# # @summary Installs and manages packages from pip. # # @param name must be unique @@ -56,7 +54,7 @@ Enum['pip', 'pip3'] $pip_provider = 'pip', Variant[Boolean, String] $url = false, String[1] $owner = 'root', - String[1] $group = 'root', + $group = getvar('python::params::group'), $umask = undef, $index = false, Variant[Boolean, String] $proxy = false, @@ -69,7 +67,7 @@ Numeric $timeout = 1800, String[1] $log_dir = '/tmp', Array[String] $path = ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], -) { +){ $python_provider = getparam(Class['python'], 'provider') $python_version = getparam(Class['python'], 'version') diff --git a/metadata.json b/metadata.json index 3f3f2eaf..dbf0c3a4 100644 --- a/metadata.json +++ b/metadata.json @@ -15,6 +15,13 @@ "gunicorn" ], "operatingsystem_support": [ + { + "operatingsystem": "AIX", + "operatingsystemrelease": [ + "6100-09-11-1810", + "7100-05-03-1837" + ] + }, { "operatingsystem": "CentOS", "operatingsystemrelease": [