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
master
Michael Prokop 7 years ago
parent aa23145fc5
commit d6c58cfc8a

@ -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</command>
</hudson.tasks.Mailer_-UserProperty>
</properties>
</user>
"
}
file { '/var/lib/jenkins/users/users.xml':
ensure => present,
mode => '0644',
owner => 'jenkins',
require => File['/var/lib/jenkins/users/'],
notify => Service['jenkins'],
content => "<?xml version='1.1' encoding='UTF-8'?>
<hudson.model.UserIdMapper>
<version>1</version>
<idToDirectoryNameMap class='concurrent-hash-map'>
<entry>
<string>jenkins-debian-glue</string>
<string>jenkins-debian-glue</string>
</entry>
</idToDirectoryNameMap>
</hudson.model.UserIdMapper>
"
}
}

Loading…
Cancel
Save