From 46518a052375067e26839b1d8dbf7fae790c44c9 Mon Sep 17 00:00:00 2001 From: Ramy Asselin Date: Fri, 22 Aug 2014 13:16:31 -0700 Subject: [PATCH] Allow zuul & nodepool to be installed on one VM When attempting to install zuul & nodepool on a single machine (typical for third party environments) you get the following error: Duplicate declaration: Package[python-lxml] is already declared in file /root/config/modules/zuul/manifests/init.pp at line 64; cannot redeclare at /root/config/modules/nodepool/manifests/init.pp:39 on node ci.novalocal Update the puppet scripts so that python-lxml do not conflict with each other. Change-Id: I63453e46702d37fa845504f31fa006b0b9fc5330 --- modules/nodepool/manifests/init.pp | 12 ++++++------ modules/zuul/manifests/init.pp | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/nodepool/manifests/init.pp b/modules/nodepool/manifests/init.pp index c05dae5a52..a4b6ca2593 100644 --- a/modules/nodepool/manifests/init.pp +++ b/modules/nodepool/manifests/init.pp @@ -30,12 +30,12 @@ class nodepool ( $environment = {}, ) { - $packages = [ - 'python-lxml', # needed by python-keystoneclient, has system bindings - ] - - package { $packages: - ensure => present, + # needed by python-keystoneclient, has system bindings + # Zuul and Nodepool both need it, so make it conditional + if ! defined(Package['python-lxml']) { + package { 'python-lxml': + ensure => present, + } } class { 'mysql::server': diff --git a/modules/zuul/manifests/init.pp b/modules/zuul/manifests/init.pp index 06bb0ef17e..59bcd3f6b7 100644 --- a/modules/zuul/manifests/init.pp +++ b/modules/zuul/manifests/init.pp @@ -54,7 +54,6 @@ class zuul ( $packages = [ 'gcc', # yappi requires this to build 'python-lockfile', - 'python-lxml', # needed by python-keystoneclient, has system bindings 'python-paste', 'python-webob', ] @@ -69,6 +68,14 @@ class zuul ( require => Class['pip'], } + # needed by python-keystoneclient, has system bindings + # Zuul and Nodepool both need it, so make it conditional + if ! defined(Package['python-lxml']) { + package { 'python-lxml': + ensure => present, + } + } + # A lot of things need yaml, be conservative requiring this package to avoid # conflicts with other modules. if ! defined(Package['python-yaml']) {