Guest User

Untitled

a guest
Feb 8th, 2018
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. - name: Add credential to add node
  2. uri:
  3. body: |
  4. json={
  5. "": "0",
  6. "credentials": {
  7. "scope": "GLOBAL",
  8. "id": "jenkins_linux_slave2_auth",
  9. "username": "jenkins",
  10. "password": "",
  11. "privateKeySource": {
  12. "stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource",
  13. "privateKey": '{{"URL ENCODED STRING"|urlencode}}'
  14. },
  15. "description": "Jenkins Linux Slave2 Authentication",
  16. "stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"
  17. }
  18. }
  19. force_basic_auth: yes
  20. method: POST
  21. password: "{{ jenkins_user_token }}"
  22. status_code: 302
  23. url: "{{ jenkins_url }}/credentials/store/system/domain/_/createCredentials"
  24. user: "{{ jenkins_user }}"
  25. validate_certs: no
  26. tags:
  27. - credential
  28.  
  29. TASK [jenkins_config : Add credential to add node] ************************************************************************************************************************************************************************************
  30. task path: /home/nile2691/ansible_playbooks/roles/jenkins_config/tasks/main.yaml:34
  31. fatal: [localhost]: FAILED! => {
  32. "msg": "template error while templating string: no filter named 'urlencode'. String: json={n "": "0",n "credentials": {n "scope": "GLOBAL",n "id": "jenkins_linux_slave2_auth",n "username": "jenkins",n "password": "",n "privateKeySource": {n "stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey$DirectEntryPrivateKeySource",n "privateKey": '{{"URL ENCODED STRING"|urlencode}}'n },n "description": "Jenkins Linux Slave2 Authentication",n "stapler-class": "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"n }n }n"
  33. }
Add Comment
Please, Sign In to add comment