register not working for uri module

610 views
Skip to first unread message

Narmada Karthika

unread,
May 18, 2023, 2:00:53 PM5/18/23
to Ansible Project
{"changed": false, "msg": "Unsupported parameters for (ansible.legacy.uri) module: register. Supported parameters include: ca_path, serole, client_key, use_proxy, setype, attributes (attr), force (thirsty), use_gssapi, force_basic_auth, seuser, src, validate_certs, client_cert, return_content, unix_socket, unsafe_writes, headers, url, creates, selevel, http_agent, mode, body, status_code, removes, method, remote_src, dest, url_password (password), url_username (user), timeout, group, body_format, follow_redirects,
this is the error I am getting
here is my playbook

--- - name: make a curl call hosts: localhost become: true user: root gather_facts: no tasks: - name: Create Weekly Release Sequence ansible.builtin.uri: url: 'https://google.com' method: GET return_content: yes body_format: json register: result - debug: var: result.stdout no_log: False

Jorge Rúa

unread,
May 18, 2023, 2:04:59 PM5/18/23
to ansible...@googlegroups.com
Your issue is that the register is not part of the module, but of the task. Check your indentation.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cd115a98-3dd4-4ccc-9071-b45c4058e3e3n%40googlegroups.com.

Todd Lewis

unread,
May 18, 2023, 2:05:08 PM5/18/23
to Ansible Project
Pull your "register:" to the left. It's a task key word, so should line up with "name:" and "ansible.builtin.uri", rather than with "url:", "method:", etc.

Narmada Karthika

unread,
May 18, 2023, 2:13:56 PM5/18/23
to Ansible Project
got it, thanks, never realized that 
Reply all
Reply to author
Forward
0 new messages