annotate modules/python/manifests/install.pp @ 432:d05e9281909c

Remove now abandoned Strike Creations website
author IBBoard <dev@ibboard.co.uk>
date Tue, 21 Feb 2023 15:54:18 +0000
parents 66c075c5f54a
children adf6fe9bbc17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 # @api private
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 # @summary Installs core python packages
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 #
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 # @example
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 # include python::install
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 #
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 class python::install {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 $python = $python::version ? {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 'system' => 'python',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 'pypy' => 'pypy',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 /\A(python[23]\.[0-9]+)/ => $1,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 /\A(python)?([0-9]+)/ => "python${2}",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 /\Arh-python[0-9]{2}/ => $python::version,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 default => "python${python::version}",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 $pythondev = $facts['os']['family'] ? {
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
18 'AIX' => "${python}-devel",
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
19 'Debian' => "${python}-dev",
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
20 'FreeBSD' => undef,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
21 'Gentoo' => undef,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
22 'RedHat' => "${python}-devel",
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
23 'Suse' => "${python}-devel",
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 $pip_ensure = $python::pip ? {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 true => 'present',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 false => 'absent',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 default => $python::pip,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
32 $dev_ensure = $python::dev ? {
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 true => 'present',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 false => 'absent',
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
35 default => $python::dev,
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
38 if $python::manage_python_package {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
39 package { 'python':
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
40 ensure => $python::ensure,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
41 name => $python,
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 case $python::provider {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 'pip': {
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
47 if $python::manage_pip_package {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
48 package { 'pip':
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
49 ensure => $pip_ensure,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
50 require => Package['python'],
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
51 }
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 if $pythondev {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 package { 'python-dev':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 ensure => $dev_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 name => $pythondev,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 # Respect the $pip_ensure setting
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 unless $pip_ensure == 'absent' {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 # Install pip without pip, see https://pip.pypa.io/en/stable/installing/.
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
64 include python::pip::bootstrap
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 Exec['bootstrap pip'] -> File['pip-python'] -> Package <| provider == pip |>
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 Package <| title == 'pip' |> {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 name => 'pip',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 provider => 'pip',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 'scl': {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 # SCL is only valid in the RedHat family. If RHEL, package must be
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 # enabled using the subscription manager outside of puppet. If CentOS,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 # the centos-release-SCL will install the repository.
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 if $python::manage_scl {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79 $install_scl_repo_package = $facts['os']['name'] ? {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 'CentOS' => 'present',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81 default => 'absent',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 package { 'centos-release-scl':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 ensure => $install_scl_repo_package,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 before => Package['scl-utils'],
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 }
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
88
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89 package { 'scl-utils':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 ensure => 'present',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
91 before => Package['python'],
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 Package['scl-utils'] -> Package["${python}-scldevel"]
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 if $pip_ensure != 'absent' {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
97 Package['scl-utils'] -> Exec['python-scl-pip-install']
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
98 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
99 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
100
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
101 package { "${python}-scldevel":
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
102 ensure => $dev_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 }
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
104
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
105 if $pip_ensure != 'absent' {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
106 exec { 'python-scl-pip-install':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
107 command => "${python::exec_prefix}easy_install pip",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
108 path => ['/usr/bin', '/bin'],
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109 creates => "/opt/rh/${python::version}/root/usr/bin/pip",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
110 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
111 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
112 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
113 'rhscl': {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
114 # rhscl is RedHat SCLs from softwarecollections.org
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
115 if $python::rhscl_use_public_repository {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116 $scl_package = "rhscl-${python::version}-epel-${facts['os']['release']['major']}-${facts['os']['architecture']}"
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
117
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
118 package { $scl_package:
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
119 source => "https://www.softwarecollections.org/en/scls/rhscl/${python::version}/epel-${facts['os']['release']['major']}-${facts['os']['architecture']}/download/${scl_package}.noarch.rpm",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
120 provider => 'rpm',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
121 tag => 'python-scl-repo',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
123 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
125 Package <| title == 'python' |> {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 tag => 'python-scl-package',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 Package <| title == 'virtualenv' |> {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 name => "${python}-python-virtualenv",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 package { "${python}-scldevel":
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134 ensure => $dev_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 tag => 'python-scl-package',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
136 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
137
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138 package { "${python}-python-pip":
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
139 ensure => $pip_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
140 tag => 'python-pip-package',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
141 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
142
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
143 if $python::rhscl_use_public_repository {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
144 Package <| tag == 'python-scl-repo' |>
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
145 -> Package <| tag == 'python-scl-package' |>
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
146 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
147
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
148 Package <| tag == 'python-scl-package' |> -> Package <| tag == 'python-pip-package' |>
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
149 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
150 'anaconda': {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
151 $installer_path = '/var/tmp/anaconda_installer.sh'
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
152
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
153 file { $installer_path:
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
154 source => $python::anaconda_installer_url,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
155 mode => '0700',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
156 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
157 -> exec { 'install_anaconda_python':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
158 command => "${installer_path} -b -p ${python::anaconda_install_path}",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159 creates => $python::anaconda_install_path,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 logoutput => true,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
161 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
162 -> exec { 'install_anaconda_virtualenv':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
163 command => "${python::anaconda_install_path}/bin/pip install virtualenv",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
164 creates => "${python::anaconda_install_path}/bin/virtualenv",
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
165 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
166 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
167 default: {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
168 case $facts['os']['family'] {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
169 'AIX': {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
170 if String($python::version) =~ /^python3/ {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
171 class { 'python::pip::bootstrap':
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
172 version => 'pip3',
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
173 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
174 } else {
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
175 if $python::manage_pip_package {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
176 package { 'python-pip':
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
177 ensure => $pip_ensure,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
178 require => Package['python'],
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
179 provider => 'yum',
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
180 }
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182 }
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
183
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 if $pythondev {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 package { 'python-dev':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186 ensure => $dev_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187 name => $pythondev,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
188 alias => $pythondev,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
189 provider => 'yum',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
191 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 default: {
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
194 if $python::manage_pip_package {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
195 package { 'pip':
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
196 ensure => $pip_ensure,
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
197 require => Package['python'],
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
198 }
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
199 }
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
200
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
201 if $pythondev {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
202 package { 'python-dev':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
203 ensure => $dev_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 name => $pythondev,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205 alias => $pythondev,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
210
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
211 if $facts['os']['family'] == 'RedHat' {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
212 if $pip_ensure != 'absent' and $python::use_epel and ($python::manage_pip_package or $python::manage_python_package) {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
213 require epel
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
216
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
217 if String($python::version) =~ /^python3/ {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
218 $pip_category = undef
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
219 $pip_package = "${python}-pip"
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
220 $pip_provider = $python.regsubst(/^.*python3\.?/,'pip3.').regsubst(/\.$/,'')
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
221 } elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '8') >= 0) {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
222 $pip_category = undef
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
223 $pip_package = 'python3-pip'
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
224 $pip_provider = pip3
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
225 } elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
226 $pip_category = undef
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
227 $pip_package = 'python2-pip'
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
228 $pip_provider = pip2
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
229 } elsif $facts['os']['family'] == 'FreeBSD' {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
230 $pip_category = undef
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
231 $pip_package = "py${python::version}-pip"
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
232 $pip_provider = 'pip'
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 } elsif $facts['os']['family'] == 'Gentoo' {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234 $pip_category = 'dev-python'
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
235 $pip_package = 'pip'
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
236 $pip_provider = 'pip'
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
237 } elsif ($facts['os']['name'] == 'Ubuntu') and (versioncmp($facts['os']['release']['major'], '20.04') >= 0) {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
238 $pip_category = undef
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
239 $pip_package = 'python3-pip'
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
240 $pip_provider = 'pip3'
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
241 } elsif ($facts['os']['name'] == 'Debian') and (versioncmp($facts['os']['release']['major'], '11') >= 0) {
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
242 $pip_category = undef
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
243 $pip_package = 'python3-pip'
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
244 $pip_provider = 'pip3'
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 } else {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 $pip_category = undef
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
247 $pip_package = 'python-pip'
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248 $pip_provider = 'pip'
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 Package <| title == 'pip' |> {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 name => $pip_package,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 category => $pip_category,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
254 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258 if $python::manage_gunicorn {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 $gunicorn_ensure = $python::gunicorn ? {
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
260 true => 'present',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261 false => 'absent',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
262 default => $python::gunicorn,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 package { 'gunicorn':
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266 ensure => $gunicorn_ensure,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 name => $python::gunicorn_package_name,
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 }