I'd start by adding a debug step to show what you actually registered:

- name: Show what got registered in pingpath
  ansible.builtin.debug:
    msg: "{{ pingpath }}"

Given that using it that way produced unexpected results, perhaps it's because the registered data aren't what you expect.

On 1/26/24 10:20 AM, [email protected] wrote:
hi,
i want to use "get-command" to get the location of a program. in the next step i want to execute this program with a full qualified location. this example is just an example, i know there are other modules for doing a ping.

i use
(get-command ping).source
to get the location. in the next step i want to execute this with a parameter:

- name: get pingpath
  win_shell: "(get-command ping).source")
  register: pingpath
- name test ping
  win_shell: "{{ pingpath }} 9.9.9.9"

that throws an error because of an
unexpected token: \":\"

any idea how to fix this?

regards,
andre

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/de8d19bc-81cd-46b6-a5b4-b0176524fe05%40gmail.com.

Reply via email to