Ensure we only define subunit worker packages once

We can only declare the packages once per node, but since we spin up
multiple workers per node, the definitions were being duplicated. This
fixes the worker.pp file to ensure we only define packages once.

Change-Id: Idc67f97b77b4f4be3864c9dacd3835bb8328d068
This commit is contained in:
Matthew Treinish 2014-11-17 15:35:37 -05:00
parent 0833068ac2
commit fca46d774f

View File

@ -21,28 +21,38 @@ define subunit2sql::worker (
) {
$suffix = "-${name}"
package { 'python-daemon':
ensure => present,
if ! defined(Package['python-daemon']) {
package { 'python-daemon':
ensure => present,
}
}
package { 'python-zmq':
ensure => present,
if ! defined(Package['python-zmq']) {
package { 'python-zmq':
ensure => present,
}
}
package { 'python-yaml':
ensure => present,
if ! defined(Package['python-yaml']) {
package { 'python-yaml':
ensure => present,
}
}
package { 'gear':
ensure => latest,
provider => 'pip',
require => Class['pip'],
if ! defined(Package['gear']) {
package { 'gear':
ensure => latest,
provider => 'pip',
require => Class['pip'],
}
}
package { 'statsd':
ensure => latest,
provider => 'pip',
require => Class['pip']
if ! defined(Package['statsd']) {
package { 'statsd':
ensure => latest,
provider => 'pip',
require => Class['pip']
}
}
file { '/usr/local/bin/subunit-gearman-worker.py':