rtyler/puppet-jenkins

How does one insert private key contents directly into private_key_or_path in jenkins::credentials?

Opened this issue · 0 comments

The script seems to be doing this:

/usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 groovy /usr/lib/jenkins/puppet_helper.groovy create_or_update_credentials user-sysadmin '' '' 'Managed by Puppet' '-----BEGIN RSA PRIVATE KEY-----
long private key contents
long private key contents
long private key contents
-----END RSA PRIVATE KEY-----
'

It tells me this when I run it by itself (this is also the output of puppet-agent):

"-----BEGIN RSA PRIVATE KEY-----
long private key contents
long private key contents
long private key contents
-----END RSA PRIVATE KEY-----
" is not a valid option
java -jar jenkins-cli.jar groovy [SCRIPT] [ARGUMENTS ...]
Executes the specified Groovy script. 
 SCRIPT    : Script to be executed. File, URL or '=' to represent stdin.
 ARGUMENTS : Command line arguments to pass into script.

I changed the declaration to a template as you had suggested:

  jenkins::credentials { 'user-sysadmin':
    password => '',
    private_key_or_path => template('common/private_key.erb'),
  }

This is the version of the module being used:

├── rtyler-jenkins (v1.6.1)