ICTO / ansible-jenkins

Ansible playbook: Jenkins
MIT License
282 stars 171 forks source link

jenkins-cli commands don't work when Jenkins authentication is turned on #21

Open flyte opened 9 years ago

flyte commented 9 years ago

I have Jenkins' own database authentication turned on with matrix based security and the ansible script can't install extensions or restart Jenkins:

failed: [10.0.0.10] => {"changed": true, "cmd": ["java", "-jar", "/opt/jenkins/jenkins-cli.jar", "-s", "http://localhost:8080", "safe-restart"], "delta": "0:00:00.866460", "end": "2014-12-10 15:55:43.202089", "rc": 1, "start": "2014-12-10 15:55:42.335629"}
stderr: hudson.security.AccessDeniedException2: anonymous is missing the Overall/Read permission

Could we have the ability to provide a username and password to use for these commands? This, and/or public key auth: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI#JenkinsCLI-WorkingwithCredentials

mputilin commented 8 years ago

any plans to fix that? and it would be great to configure security using that role too

mpodber1971 commented 7 years ago

see https://github.com/ICTO/ansible-jenkins/issues/61

takluyver commented 7 years ago

I have worked around this by setting up an SSH key and adding -ssh -user {{ jenkins_admin_user }} to the end of jenkins_cli_cmd . But I don't know how to automate generating an ssh key and adding it to Jenkins config.