Advertisement
Guest User

Untitled

a guest
May 12th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. - block:
  2. - name: Sync ldap groups
  3. uri:
  4. url: "{{ ambari_current_protocol }}://{{ ambari_server_host }}:{{ ambari_current_port }}/api/v1/ldap_sync_events"
  5. method: POST
  6. force_basic_auth: yes
  7. user: "{{ ambari_user }}"
  8. password: "{{ ambari_password }}"
  9. HEADER_X-Requested-By: "ambari"
  10. body: "{{ ldap_group_body |to_json}}"
  11. validate_certs: no
  12. status_code: 200,201,202
  13. return_content: yes
  14. register: sync_ldap
  15. with_items: "{{ ldap_groups }}"
  16. tags: force_sync_ldap
  17.  
  18. - name: Check sync ldap
  19. uri:
  20. url: "{{ (item.content|from_json).resources[0].href }}"
  21. method: GET
  22. force_basic_auth: yes
  23. user: "{{ ambari_user }}"
  24. password: "{{ ambari_password }}"
  25. HEADER_X-Requested-By: "ambari"
  26. validate_certs: no
  27. status_code: 200,201,202
  28. return_content: yes
  29. register: check_ldap
  30. retries: 50
  31. delay: 10
  32. until: (check_ldap.content|from_json).Event.status == "COMPLETE"
  33. with_items: "{{ sync_ldap.results }}"
  34. tags: force_sync_ldap
  35. when: ldap_status_after.rc == 0
  36. tags:
  37. - ldap
  38. - force_sync_ldap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement