mika / jenkins-debian-glue

Scripts for Debian package/repository handling inside Jenkins
MIT License
131 stars 91 forks source link

puppet: jenkins-debian-glue user setup is broken #223

Closed mika closed 5 years ago

mika commented 5 years ago

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.

In some "recent" Jenkins version the user setup/behavior was changed, see e.g. https://jenkins.io/doc/upgrade-guide/2.138/

We now have:

$ ls /var/lib/jenkins/users
admin_7874529936968002089  jenkins-debian-glue  users.xml
$ cat /var/lib/jenkins/users/users.xml 
<?xml version='1.1' encoding='UTF-8'?>
<hudson.model.UserIdMapper>
  <version>1</version>
  <idToDirectoryNameMap class="concurrent-hash-map">
    <entry>
      <string>admin</string>
      <string>admin_7874529936968002089</string>
    </entry>
  </idToDirectoryNameMap>
</hudson.model.UserIdMapper>

... while this doesn't work for us (jenkins-debian-glue user isn't configured). We'd have to ship to a /var/lib/jenkins/users/users.xml file like:

<?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>