Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - block:
- - name: Sync ldap groups
- uri:
- url: "{{ ambari_current_protocol }}://{{ ambari_server_host }}:{{ ambari_current_port }}/api/v1/ldap_sync_events"
- method: POST
- force_basic_auth: yes
- user: "{{ ambari_user }}"
- password: "{{ ambari_password }}"
- HEADER_X-Requested-By: "ambari"
- body: "{{ ldap_group_body |to_json}}"
- validate_certs: no
- status_code: 200,201,202
- return_content: yes
- register: sync_ldap
- with_items: "{{ ldap_groups }}"
- tags: force_sync_ldap
- - name: Check sync ldap
- uri:
- url: "{{ (item.content|from_json).resources[0].href }}"
- method: GET
- force_basic_auth: yes
- user: "{{ ambari_user }}"
- password: "{{ ambari_password }}"
- HEADER_X-Requested-By: "ambari"
- validate_certs: no
- status_code: 200,201,202
- return_content: yes
- register: check_ldap
- retries: 50
- delay: 10
- until: (check_ldap.content|from_json).Event.status == "COMPLETE"
- with_items: "{{ sync_ldap.results }}"
- tags: force_sync_ldap
- when: ldap_status_after.rc == 0
- tags:
- - ldap
- - force_sync_ldap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement