puppet-jenkins: Initial setup fail to create user - ERROR: anonymous is missing the Overall/Read permission

With [part of] the manifest looking like this:

    $adm_pw = hiera('jenkins_admin_user', undef)
[...]
        user_hash => {
            'admin' => {
                'password' => "$adm_pw",
                'email'    => 'it-ops@rpharms.com'
            }
        },

I get:

Notice: /Stage[main]/Jenkins::Users/Jenkins::User[admin]/Jenkins::Cli::Exec[create-jenkins-user-admin]/Exec[create-jenkins-user-admin]/returns:
Notice: /Stage[main]/Jenkins::Users/Jenkins::User[admin]/Jenkins::Cli::Exec[create-jenkins-user-admin]/Exec[create-jenkins-user-admin]/returns: ERROR: anonymous is missing the Overall/Read permission
Error: /usr/bin/java -jar /usr/share/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 groovy /usr/share/jenkins/puppet_helper.groovy create_or_update_user admin mail@domain.tld 'secret' 'Managed by Puppet' '' returned 6 instead of one of [0]
Error: /Stage[main]/Jenkins::Users/Jenkins::User[admin]/Jenkins::Cli::Exec[create-jenkins-user-admin]/Exec[create-jenkins-user-admin]/returns: change from notrun to 0 failed: /usr/bin/java -jar /usr/share/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 groovy /usr/share/jenkins/puppet_helper.groovy create_or_update_user admin mail@domain.tld 'secret' 'Managed by Puppet' '' returned 6 instead of one of [0]

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

@jhoblitt Got it, that makes sense.

I have been able to install .deb packages without starting daemons by setting the env var RUNLEVEL=1 during the install. i.e. RUNLEVEL=1 apt-get install -y jenkins works perfectly and doesn’t start the daemon.

Unfortunately, there’s an open ticket for setting env vars for the package type. Not sure what your thoughts are on a workaround for now, maybe by installing using exec rather than package for debian OSes?

@jhoblitt running on CentOS.

What I have been doing with the 2.x release has been to perform a 3 pass puppet run, first by running the puppet-jenkins module with the jenkins service ‘stopped’, followed by updating the config.xml with the AuthorizationStrategy$Unsecured and SecurityRealm$None settings, running through the module again, then followed by changing the config.xml with and ldap/matrix setup. Not optimal, but it got me through. Looking at possibly handling this inside the module, but I’m not too familiar with the code, so it will take me some time to ramp up.