diff --git a/modules/subunit2sql/manifests/init.pp b/modules/subunit2sql/manifests/init.pp index ad0279cf83..c0a78f49eb 100644 --- a/modules/subunit2sql/manifests/init.pp +++ b/modules/subunit2sql/manifests/init.pp @@ -49,4 +49,54 @@ class subunit2sql ( require => Class['pip'], } + if ! defined(Package['python-daemon']) { + package { 'python-daemon': + ensure => present, + } + } + + if ! defined(Package['python-zmq']) { + package { 'python-zmq': + ensure => present, + } + } + + if ! defined(Package['python-yaml']) { + package { 'python-yaml': + ensure => present, + } + } + + if ! defined(Package['gear']) { + package { 'gear': + 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': + ensure => present, + owner => 'root', + group => 'root', + mode => '0755', + source => 'puppet:///modules/log_processor/subunit-gearman-worker.py', + require => [ + Package['python-daemon'], + Package['python-zmq'], + Package['python-yaml'], + Package['gear'], + Package['subunit2sql'], + Package['python-subunit'], + Package['testtools'] + ], + } } diff --git a/modules/subunit2sql/manifests/worker.pp b/modules/subunit2sql/manifests/worker.pp index 7161b06cff..a18e8811fd 100644 --- a/modules/subunit2sql/manifests/worker.pp +++ b/modules/subunit2sql/manifests/worker.pp @@ -21,66 +21,17 @@ define subunit2sql::worker ( ) { $suffix = "-${name}" - if ! defined(Package['python-daemon']) { - package { 'python-daemon': - ensure => present, + if ! defined(File['/etc/logstash/subunit2sql.conf']) { + file { '/etc/logstash/subunit2sql.conf': + ensure => present, + owner => 'root', + group => 'root', + mode => '0555', + content => template('subunit2sql/subunit2sql.conf.erb'), + require => Class['logstash::indexer'], } } - if ! defined(Package['python-zmq']) { - package { 'python-zmq': - ensure => present, - } - } - - if ! defined(Package['python-yaml']) { - package { 'python-yaml': - ensure => present, - } - } - - if ! defined(Package['gear']) { - package { 'gear': - 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': - ensure => present, - owner => 'root', - group => 'root', - mode => '0755', - source => 'puppet:///modules/log_processor/subunit-gearman-worker.py', - require => [ - Package['python-daemon'], - Package['python-zmq'], - Package['python-yaml'], - Package['gear'], - Package['subunit2sql'], - Package['python-subunit'], - Package['testtools'] - ], - } - - file { '/etc/logstash/subunit2sql.conf': - ensure => present, - owner => 'root', - group => 'root', - mode => '0555', - content => template('subunit2sql/subunit2sql.conf.erb'), - require => Class['logstash::indexer'], - } - file { "/etc/logstash/jenkins-subunit-worker${suffix}.yaml": ensure => present, owner => 'root',