Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials #370

Open
jimbomed opened this issue Sep 7, 2015 · 2 comments
Open

Credentials #370

jimbomed opened this issue Sep 7, 2015 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jimbomed
Copy link

jimbomed commented Sep 7, 2015

having trouble creating new credentials
added to profile:
jenkins::credentials { 'name-key':
password => '',
private_key_or_path => hiera('namekey_key'),
}

error:
Error: /Stage[main]/Profiles::Jenkins/Jenkins::Credentials[namekey-key]/Jenkins::Cli::Exec[create-jenkins-credentials-namekey-key]/Exec[create-jenkins-credentials-name-key]/unless: Check "$HELPER_CMD credential_info name-key | grep name-key" exceeded timeout

@rtyler rtyler added the bug Something isn't working label Sep 9, 2015
@rtyler rtyler self-assigned this Sep 9, 2015
@Perdjesk
Copy link

The problem comes from the jenkins-cli.jar not handling correctly the private key argument when it is the content itself. It is due to the dash characters interpreted as option of the command line even if surrounded with quotes.

Debug: Exec[create-jenkins-credentials-test1@example.com](provider=shell): Executing '["/bin/sh", "-c", "/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_credentials test1@example.com '' '' 'Managed by Puppet' '-----BEGIN'"]'
Debug: Executing '/bin/sh -c /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_credentials test1@example.com '' '' 'Managed by Puppet' '-----BEGIN''
Debug: /Stage[main]/Main/Node[default]/Jenkins::Credentials[test1@example.com]/Jenkins::Cli::Exec[create-jenkins-credentials-test1@example.com]/Exec[create-jenkins-credentials-test1@example.com]/returns: Sleeping for 10.0 seconds between tries
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_credentials test6@example.com '' '' 'Managed by Puppet' '-----BEGIN'
"-----BEGIN" 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.

@jhoblitt
Copy link
Member

jhoblitt commented Oct 2, 2015

I have opened a PR for comments that provides an alternative credentials type that should correctly handle cli authenication. #382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants