Skip to content

Instantly share code, notes, and snippets.

@metabsd
Created August 2, 2018 20:52
Show Gist options
  • Save metabsd/81c708748a5ca9e33c3108a1263a9ed3 to your computer and use it in GitHub Desktop.
Save metabsd/81c708748a5ca9e33c3108a1263a9ed3 to your computer and use it in GitHub Desktop.
- name: Generate the report
uri:
method: GET
return_content: yes
status_code: 200
user: "reporting_user"
password: "superduperpassword"
force_basic_auth: yes
url: "https://kibana.domain:5601{{ genreport.json.path }}"
dest: /tmp/test-max-cpu-stats-prod-wm.pdf
headers:
kbn-xsrf: "reporting"
Content-Type: "application/json"
validate_certs: no
delegate_to: localhost
register: downloadreport
until: downloadreport.status == 503
retries: 30
delay: 10
The result :
TASK [Generate the report] *********************************************************************************************************************************************
fatal: [localhost -> localhost]: FAILED! => {"accept_ranges": "none", "attempts": 1, "cache_control": "no-cache", "changed": false, "connection": "close", "content": "pending", "content_length": "7", "content_type": "application/json; charset=utf-8", "date": "Thu, 02 Aug 2018 20:48:27 GMT", "gid": 10000, "group": "group", "kbn_name": "kibana", "kbn_version": "6.3.1", "kbn_xpack_sig": "3f3447b341ec67c6726d00c707854874", "mode": "0644", "msg": "Status code was 503 and not [200]: HTTP Error 503: Service Unavailable", "owner": "user", "path": "/tmp/test-max-cpu-stats-prod-wm.pdf", "redirected": false, "retry_after": "30", "set_cookie": "; Secure; HttpOnly; Path=/", "size": 7, "state": "file", "status": 503, "uid": 10100, "url": "https://kibana.domain:5601/api/reporting/jobs/download/jkd18mry00mr3807e868aehn", "vary": "accept-encoding"}
to retry, use: --limit @/home/user/Ansible/ABC/ELK/playbooks/export_pdf_report.retry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment