A
A
Aleksandr2021-10-07 14:16:09
Ansible
Aleksandr, 2021-10-07 14:16:09

How to write the result of a GET request to a variable?

Hello everyone, I can’t figure out how to write the result of a GET request to a playbook. Here is the request in response to which I receive a token:

- name: Getings session token
  uri:
    url: "{{ url_glpi_token }}"
    method: GET
    status_code: 200
  ignore_errors: false
  register: result


How can this result be written to a variable so that it can be used in the next step?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxKozlov, 2021-10-07
@QQQ-RRR

https://docs.ansible.com/ansible/latest/collection...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question