From 137212ff0c06ce6ef7d0ab4027c4aa79250d6c60 Mon Sep 17 00:00:00 2001 From: James Kirsop Date: Mon, 29 Oct 2018 15:59:24 +1100 Subject: [PATCH 1/5] Working solution on CentOS7 --- manifests/install.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index fe0e1911..b7f6d6d9 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -233,9 +233,12 @@ } } - if "${::python::version}" =~ /^python3/ { #lint:ignore:only_variable_string + if "${::python::version}" =~ /^python3/ and ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { #lint:ignore:only_variable_string $pip_category = undef - $pip_package = 'python3-pip' + $pip_package = 'python34-pip' + } elsif "${::python::version}" =~ /^python3/ { + $pip_category = undef + $pip_package = '1' } elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { $pip_category = undef $pip_package = 'python2-pip' From 0bdebda89f8250f0f455e4668ed997448464b1a1 Mon Sep 17 00:00:00 2001 From: James Kirsop Date: Fri, 2 Nov 2018 22:34:47 +1100 Subject: [PATCH 2/5] Cleaning up syntax --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index b7f6d6d9..57330bd5 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -233,7 +233,7 @@ } } - if "${::python::version}" =~ /^python3/ and ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { #lint:ignore:only_variable_string + if "${python::version}" =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { #lint:ignore:only_variable_string $pip_category = undef $pip_package = 'python34-pip' } elsif "${::python::version}" =~ /^python3/ { From 024c3746d48870b009dd57e1284052b8ae54b5dc Mon Sep 17 00:00:00 2001 From: James Kirsop Date: Mon, 5 Nov 2018 07:33:29 +1100 Subject: [PATCH 3/5] Hopeful fix for Travis errors --- manifests/install.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 57330bd5..d544ff1a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -233,10 +233,10 @@ } } - if "${python::version}" =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { #lint:ignore:only_variable_string + if "${python::version}" =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { $pip_category = undef $pip_package = 'python34-pip' - } elsif "${::python::version}" =~ /^python3/ { + } elsif "${python::version}" =~ /^python3/ { $pip_category = undef $pip_package = '1' } elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { From 653c0c5cd436e829fc85763962572d8b1f4dacbb Mon Sep 17 00:00:00 2001 From: James Kirsop Date: Mon, 5 Nov 2018 08:35:52 +1100 Subject: [PATCH 4/5] Puppet Lint fixes --- manifests/install.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index d544ff1a..1cb0906a 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -233,10 +233,10 @@ } } - if "${python::version}" =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { + if ${python::version} =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { $pip_category = undef $pip_package = 'python34-pip' - } elsif "${python::version}" =~ /^python3/ { + } elsif ${python::version} =~ /^python3/ { $pip_category = undef $pip_package = '1' } elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) { From 0ef5b8575934c979fde329ae59637b3f8e58958d Mon Sep 17 00:00:00 2001 From: James Kirsop Date: Mon, 5 Nov 2018 08:49:30 +1100 Subject: [PATCH 5/5] Round 3... --- manifests/install.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 1cb0906a..cbe7713f 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -233,10 +233,10 @@ } } - if ${python::version} =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { + if "${python::version}" =~ /^python3/ and ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { #lint:ignore:only_variable_string $pip_category = undef $pip_package = 'python34-pip' - } elsif ${python::version} =~ /^python3/ { + } elsif "${python::version}" =~ /^python3/ { #lint:ignore:only_variable_string $pip_category = undef $pip_package = '1' } elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) {