From d6c58cfc8ac004b6e6d3d1bc1d11d62748429efc Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 4 Apr 2019 12:02:02 +0200 Subject: [PATCH] puppet: fix broken user setup with recent Jenkins versions If no user setup is present Jenkins handles this via /var/lib/jenkins/secrets/initialAdminPassword and its setup wizard nowadays. That's something we'd might want to skip, since we provide the user password on the command line and provide the plugins we need via our puppet setup. Jenkins versions >2.138.4 migrate the user records to a slightly different storage format that uses a central index to map user IDs to directory names, also see https://jenkins.io/doc/upgrade-guide/2.138/ Closes: https://github.com/mika/jenkins-debian-glue/issues/223 --- puppet/jenkins_debian_glue.pp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/puppet/jenkins_debian_glue.pp b/puppet/jenkins_debian_glue.pp index 3fab690..5624063 100644 --- a/puppet/jenkins_debian_glue.pp +++ b/puppet/jenkins_debian_glue.pp @@ -298,7 +298,10 @@ class jenkins::software { service { 'jenkins': ensure => running, - require => Package['jenkins'], + require => [ + Package['jenkins'], + File['/var/lib/jenkins/users/users.xml'], + ] } package { 'sudo': @@ -724,6 +727,25 @@ sudo piuparts_wrapper \${PWD}/artifacts/*.deb || true +" + } + + file { '/var/lib/jenkins/users/users.xml': + ensure => present, + mode => '0644', + owner => 'jenkins', + require => File['/var/lib/jenkins/users/'], + notify => Service['jenkins'], + content => " + + 1 + + + jenkins-debian-glue + jenkins-debian-glue + + + " } }