From 9bdf19978e5f318a244463422289129c9e8fffb0 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Tue, 21 Apr 2015 17:19:48 +0000 Subject: [PATCH] Use openstackci module for zuul_merger zuul_prod and zuul_dev Depends-On: I48e49c760d5304bd7dd5b0bbbdaa27329b2d8a5f Change-Id: I98ab36cca49f8784fc93c46db69bc2a777a61938 --- .../openstack_project/manifests/zuul_dev.pp | 60 ++++++------------- .../manifests/zuul_merger.pp | 43 ++++--------- .../openstack_project/manifests/zuul_prod.pp | 40 +++---------- 3 files changed, 39 insertions(+), 104 deletions(-) diff --git a/modules/openstack_project/manifests/zuul_dev.pp b/modules/openstack_project/manifests/zuul_dev.pp index 8f93cc0e8f..52b6cd119a 100644 --- a/modules/openstack_project/manifests/zuul_dev.pp +++ b/modules/openstack_project/manifests/zuul_dev.pp @@ -30,49 +30,25 @@ class openstack_project::zuul_dev( sysadmins => $sysadmins, } - class { 'project_config': - url => $project_config_repo, - base => 'dev/', + class { 'openstackci::zuul_scheduler': + vhost_name => $vhost_name, + gearman_server => $gearman_server, + gerrit_server => $gerrit_server, + gerrit_user => $gerrit_user, + known_hosts_content => "review-dev.openstack.org,23.253.78.13,2001:4800:7817:101:be76:4eff:fe04 ${gerrit_ssh_host_key}", + zuul_ssh_private_key => $zuul_ssh_private_key, + url_pattern => $url_pattern, + zuul_url => $zuul_url, + job_name_in_report => true, + status_url => $status_url, + statsd_host => $statsd_host, + git_email => 'jenkins@openstack.org', + git_name => 'OpenStack Jenkins', + project_config_repo => $project_config_repo, + project_config_base => 'dev/', } - class { '::zuul': - vhost_name => $vhost_name, - gearman_server => $gearman_server, - gerrit_server => $gerrit_server, - gerrit_user => $gerrit_user, - zuul_ssh_private_key => $zuul_ssh_private_key, - url_pattern => $url_pattern, - zuul_url => $zuul_url, - job_name_in_report => true, - status_url => $status_url, - statsd_host => $statsd_host, - git_email => 'jenkins@openstack.org', - git_name => 'OpenStack Jenkins', - } - - class { '::zuul::server': - layout_dir => $::project_config::zuul_layout_dir, - require => $::project_config::config_dir, - } - - class { '::zuul::merger': } - - if $gerrit_ssh_host_key != '' { - file { '/home/zuul/.ssh': - ensure => directory, - owner => 'zuul', - group => 'zuul', - mode => '0700', - require => Class['::zuul'], - } - file { '/home/zuul/.ssh/known_hosts': - ensure => present, - owner => 'zuul', - group => 'zuul', - mode => '0600', - content => "review-dev.openstack.org,23.253.78.13,2001:4800:7817:101:be76:4eff:fe04 ${gerrit_ssh_host_key}", - replace => true, - require => File['/home/zuul/.ssh'], - } + class { 'openstackci::zuul_merger': + manage_common_zuul => false, } } diff --git a/modules/openstack_project/manifests/zuul_merger.pp b/modules/openstack_project/manifests/zuul_merger.pp index 5b595e3855..3d1698a7e3 100644 --- a/modules/openstack_project/manifests/zuul_merger.pp +++ b/modules/openstack_project/manifests/zuul_merger.pp @@ -9,6 +9,8 @@ class openstack_project::zuul_merger( $zuul_ssh_private_key = '', $zuul_url = "http://${::fqdn}/p", $sysadmins = [], + $git_email = 'jenkins@openstack.org', + $git_name = 'OpenStack Jenkins', ) { class { 'openstack_project::server': @@ -16,35 +18,16 @@ class openstack_project::zuul_merger( sysadmins => $sysadmins, } - class { '::zuul': - vhost_name => $vhost_name, - gearman_server => $gearman_server, - gerrit_server => $gerrit_server, - gerrit_user => $gerrit_user, - zuul_ssh_private_key => $zuul_ssh_private_key, - zuul_url => $zuul_url, - git_email => 'jenkins@openstack.org', - git_name => 'OpenStack Jenkins', - } - - class { '::zuul::merger': } - - if $gerrit_ssh_host_key != '' { - file { '/home/zuul/.ssh': - ensure => directory, - owner => 'zuul', - group => 'zuul', - mode => '0700', - require => Class['::zuul'], - } - file { '/home/zuul/.ssh/known_hosts': - ensure => present, - owner => 'zuul', - group => 'zuul', - mode => '0600', - content => "review.openstack.org,23.253.232.87,2001:4800:7815:104:3bc3:d7f6:ff03:bf5d ${gerrit_ssh_host_key}", - replace => true, - require => File['/home/zuul/.ssh'], - } + class { 'openstackci::zuul_merger': + vhost_name => $vhost_name, + gearman_server => $gearman_server, + gerrit_server => $gerrit_server, + gerrit_user => $gerrit_user, + known_hosts_content => "review.openstack.org,23.253.232.87,2001:4800:7815:104:3bc3:d7f6:ff03:bf5d ${gerrit_ssh_host_key}", + zuul_ssh_private_key => $zuul_ssh_private_key, + zuul_url => $zuul_url, + git_email => $git_email, + git_name => $git_name, + manage_common_zuul => true, } } diff --git a/modules/openstack_project/manifests/zuul_prod.pp b/modules/openstack_project/manifests/zuul_prod.pp index e67134ead8..7250aab0f4 100644 --- a/modules/openstack_project/manifests/zuul_prod.pp +++ b/modules/openstack_project/manifests/zuul_prod.pp @@ -26,6 +26,8 @@ class openstack_project::zuul_prod( $statsd_host = '', $gearman_workers = [], $project_config_repo = '', + $git_email = 'jenkins@openstack.org', + $git_name = 'OpenStack Jenkins', ) { # Turn a list of hostnames into a list of iptables rules $iptables_rules = regsubst ($gearman_workers, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 4730 -s \1 -j ACCEPT') @@ -37,23 +39,17 @@ class openstack_project::zuul_prod( sysadmins => $sysadmins, } - class { 'project_config': - url => $project_config_repo, - } - - class { '::zuul': + class { 'openstackci::zuul_scheduler': vhost_name => $vhost_name, gearman_server => $gearman_server, gerrit_server => $gerrit_server, gerrit_user => $gerrit_user, + known_hosts_content => "review.openstack.org,104.130.159.134,2001:4800:7818:102:be76:4eff:fe05:9b12 ${gerrit_ssh_host_key}", zuul_ssh_private_key => $zuul_ssh_private_key, url_pattern => $url_pattern, zuul_url => $zuul_url, job_name_in_report => true, status_url => $status_url, - statsd_host => $statsd_host, - git_email => 'jenkins@openstack.org', - git_name => 'OpenStack Jenkins', swift_authurl => $swift_authurl, swift_auth_version => $swift_auth_version, swift_user => $swift_user, @@ -66,29 +62,9 @@ class openstack_project::zuul_prod( proxy_ssl_cert_file_contents => $proxy_ssl_cert_file_contents, proxy_ssl_key_file_contents => $proxy_ssl_key_file_contents, proxy_ssl_chain_file_contents => $proxy_ssl_chain_file_contents, - } - - class { '::zuul::server': - layout_dir => $::project_config::zuul_layout_dir, - require => $::project_config::config_dir, - } - - if $gerrit_ssh_host_key != '' { - file { '/home/zuul/.ssh': - ensure => directory, - owner => 'zuul', - group => 'zuul', - mode => '0700', - require => Class['::zuul'], - } - file { '/home/zuul/.ssh/known_hosts': - ensure => present, - owner => 'zuul', - group => 'zuul', - mode => '0600', - content => "review.openstack.org,104.130.159.134,2001:4800:7818:102:be76:4eff:fe05:9b12 ${gerrit_ssh_host_key}", - replace => true, - require => File['/home/zuul/.ssh'], - } + statsd_host => $statsd_host, + project_config_repo => $project_config_repo, + git_email => $git_email, + git_name => $git_name, } }