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

ERROR: anonymous is missing the Job/Create permission #25

Closed
scottrigby opened this issue Feb 15, 2017 · 2 comments
Closed

ERROR: anonymous is missing the Job/Create permission #25

scottrigby opened this issue Feb 15, 2017 · 2 comments

Comments

@scottrigby
Copy link
Contributor

Got to run for tonight, but ran across another issue:

TASK [Import the Jenkins jobs.] ************************************************
failed: [drupalci] (item=7) => {"changed": false, "cmd": "java -jar /opt/jenkins-cli.jar -s http://drupalci:8080/ create-job \"Drupal 7\" < /root/Drupal7.xml", "delta": "0:00:01.879365", "end": "2017-02-15 17:11:15.887110", "failed": true, "failed_when_result": true, "item": "7", "rc": 6, "start": "2017-02-15 17:11:14.007745", "stderr": "\nERROR: anonymous is missing the Job/Create permission", "stdout": "", "stdout_lines": [], "warnings": []}
failed: [drupalci] (item=8) => {"changed": false, "cmd": "java -jar /opt/jenkins-cli.jar -s http://drupalci:8080/ create-job \"Drupal 8\" < /root/Drupal8.xml", "delta": "0:00:01.797923", "end": "2017-02-15 17:11:21.969324", "failed": true, "failed_when_result": true, "item": "8", "rc": 6, "start": "2017-02-15 17:11:20.171401", "stderr": "\nERROR: anonymous is missing the Job/Create permission", "stdout": "", "stdout_lines": [], "warnings": []}

Seems to be related to https://issues.jenkins-ci.org/browse/JENKINS-21086

There the recommended fix was logging into Jenkins CLI first, like this:

@@ -26,6 +26,7 @@
 # SEE: http://stackoverflow.com/a/9954283/100134
 - name: Import the Jenkins jobs.
   shell: >
+    java -jar {{ jenkins_jar_location }} -s http://{{ inventory_hostname }}:8080 login --username "$JCLIUSER" --password "$JCLIPASSWD"
     java -jar {{ jenkins_jar_location }} -s http://{{ inventory_hostname }}:8080/
     create-job "Drupal {{ item }}" < {{ workspace }}/Drupal{{ item }}.xml
   register: import
diff --git a/provisioning/vars/main.yml b/provisioning/vars/main.yml
index b21c976..517a845 100644
--- a/provisioning/vars/main.yml
+++ b/provisioning/vars/main.yml

I have to run now otherwise would test it. Not sure if $JCLIUSER and $JCLIPASSWD are available env vars on the server or not?

@scottrigby
Copy link
Contributor Author

That seems to have worked

@geerlingguy
Copy link
Owner

This project is being deprecated (though the underlying roles are still maintained); please see #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants