From f2d91af336dd33d59db64c8f61b9a0f02b152590 Mon Sep 17 00:00:00 2001 From: Kengo Seki Date: Fri, 3 Jun 2016 05:21:38 +0000 Subject: BIGTOP-2374: Toolchain needs clear warning for Puppet <3 Signed-off-by: Konstantin Boudnik --- bigtop_toolchain/manifests/puppet-modules-prereq.pp | 21 +++++++++++++++++++++ bigtop_toolchain/manifests/puppet-modules.pp | 7 +++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 bigtop_toolchain/manifests/puppet-modules-prereq.pp (limited to 'bigtop_toolchain') diff --git a/bigtop_toolchain/manifests/puppet-modules-prereq.pp b/bigtop_toolchain/manifests/puppet-modules-prereq.pp new file mode 100644 index 00000000..7b6a8cf9 --- /dev/null +++ b/bigtop_toolchain/manifests/puppet-modules-prereq.pp @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +class bigtop_toolchain::puppet-modules-prereq { + + if versioncmp($::puppetversion,'3.0.0') < 0 { + fail("bigtop_toolchain::puppet-modules requires Puppet 3.0.0+, but found: $::puppetversion") + } +} diff --git a/bigtop_toolchain/manifests/puppet-modules.pp b/bigtop_toolchain/manifests/puppet-modules.pp index 20b39f84..3fab254f 100644 --- a/bigtop_toolchain/manifests/puppet-modules.pp +++ b/bigtop_toolchain/manifests/puppet-modules.pp @@ -18,7 +18,6 @@ class bigtop_toolchain::puppet-modules { exec { 'install-puppet-stdlib': path => '/usr/bin:/bin', command => 'puppet module install puppetlabs-stdlib', - onlyif => "test `facter puppetversion |cut -d'.' -f 1` -ge 3", creates => '/etc/puppet/modules/stdlib', } @@ -27,9 +26,13 @@ class bigtop_toolchain::puppet-modules { exec { 'install-puppet-apt': path => '/usr/bin:/bin', command => 'puppet module install puppetlabs-apt', - onlyif => "test `facter puppetversion |cut -d'.' -f 1` -ge 3", creates => '/etc/puppet/modules/apt', } } } + + stage { 'first': + before => Stage['main'], + } + class { 'bigtop_toolchain::puppet-modules-prereq': stage => 'first' } } -- cgit v1.2.3