Move jenkins job builder into jenkins_master
The idea is that an openstackci user should be able to say "give me an openstackci::jenkins_master" and part of that should be to set up JJB correctly. So we move JJB setup into jenkins_master to make that happen. There was a request to make these JJB param names more consistent and less ambiguous to third party devs in change Ibc7a46a8cb364 so this change also updates jjb param names to be more sensible. Update the zuul scheduler as part of this patch to avoid puppet duplicate definition errors for Class['project_config'] that would result when this patch lands. Needed-by: Id10d63745fff43f3188e630df38c8c9ba97c3e17 Change-Id: I50d4d2dd4209250e14ceeb7ff8ddf5b6ba3e2ad4
This commit is contained in:
		| @@ -2,6 +2,8 @@ | ||||
| # | ||||
| class openstackci::jenkins_master ( | ||||
|   $serveradmin, | ||||
|   $jenkins_username        = 'jenkins', | ||||
|   $jenkins_password        = 'secret', | ||||
|   $vhost_name              = $::fqdn, | ||||
|   $logo                    = '', # Logo must be present in puppet-jenkins/files | ||||
|   $ssl_cert_file           = '/etc/ssl/certs/ssl-cert-snakeoil.pem', | ||||
| @@ -12,6 +14,13 @@ class openstackci::jenkins_master ( | ||||
|   $ssl_chain_file_contents = '', | ||||
|   $jenkins_ssh_private_key = '', | ||||
|   $jenkins_ssh_public_key  = '', | ||||
|   $manage_jenkins_jobs     = false, | ||||
|   $jenkins_url             = 'http://localhost:8080', | ||||
|   $jjb_update_timeout      = 1200, | ||||
|   $jjb_git_url             = 'https://git.openstack.org/openstack-infra/jenkins-job-builder', | ||||
|   $jjb_git_revision        = 'master', | ||||
|   $project_config_repo     = '', | ||||
|   $project_config_base     = '', | ||||
| ) { | ||||
|  | ||||
|   class { '::jenkins::master': | ||||
| @@ -86,4 +95,24 @@ class openstackci::jenkins_master ( | ||||
|   jenkins::plugin { 'token-macro': | ||||
|     version => '1.5.1', | ||||
|   } | ||||
|  | ||||
|   if $manage_jenkins_jobs == true { | ||||
|     if ! defined(Class['project_config']) { | ||||
|       class { 'project_config': | ||||
|         url  => $project_config_repo, | ||||
|         base => $project_config_base, | ||||
|       } | ||||
|     } | ||||
|     class { '::jenkins::job_builder': | ||||
|       url                         => $jenkins_url, | ||||
|       username                    => $jenkins_username, | ||||
|       password                    => $jenkins_password, | ||||
|       jenkins_jobs_update_timeout => $jjb_update_timeout, | ||||
|       git_revision                => $jjb_git_revision, | ||||
|       git_url                     => $jjb_git_url, | ||||
|       config_dir                  => | ||||
|         $::project_config::jenkins_job_builder_config_dir, | ||||
|       require                     => $::project_config::config_dir, | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -46,9 +46,11 @@ class openstackci::zuul_scheduler( | ||||
|   $git_name = 'Zuul', | ||||
| ) { | ||||
|  | ||||
|   class { 'project_config': | ||||
|     url  => $project_config_repo, | ||||
|     base => $project_config_base, | ||||
|   if ! defined(Class['project_config']) { | ||||
|     class { 'project_config': | ||||
|       url  => $project_config_repo, | ||||
|       base => $project_config_base, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   class { '::zuul': | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Khai Do
					Khai Do