From 2aa06a80e183d60d6841418e52f154a38ebd0fd9 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 28 Feb 2019 12:31:13 +1100 Subject: [PATCH] Fix pip ordering and build requirements When bootstrapping a new server it's noticed that pip wasn't installed before trying to use it. Add it as a dependency of the pip installs. It was installed by the time the whisper install ran, but there no gcc required for some of the dependencies. Add build-essential. Change-Id: I29af4665a1ef7c6f78d9fae29db066ea64743d70 --- manifests/init.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index e9acfa0..c818b40 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -69,7 +69,8 @@ class graphite( path => '/usr/local/bin:/usr/bin:/bin', refreshonly => true, subscribe => Vcsrepo['/opt/graphite-web'], - require => [Exec['install_carbon'], + require => [Class['pip'], + Exec['install_carbon'], File['/var/lib/graphite/storage']] } @@ -87,7 +88,8 @@ class graphite( path => '/usr/local/bin:/usr/bin:/bin', refreshonly => true, subscribe => Vcsrepo['/opt/carbon'], - require => [Exec['install_whisper'], + require => [Class['pip'], + Exec['install_whisper'], File['/var/lib/graphite/storage']] } @@ -98,11 +100,21 @@ class graphite( source => 'https://github.com/graphite-project/whisper.git', } + if ! defined(Package['build-essential']) { + package { 'build-essential': + ensure => present, + } + } + exec { 'install_whisper' : command => 'pip install /opt/whisper', path => '/usr/local/bin:/usr/bin:/bin/', refreshonly => true, subscribe => Vcsrepo['/opt/whisper'], + require => [ + Class['pip'], + Package['build-essential'], + ], } user { 'statsd':