hello, I am having a hard time finding anything in google on how to remove 
whitespace from the stdout results.

Here is the play:

  tasks:
    - name: get droplet IPs from inventory
      shell: ansible -i hosts testing --list-hosts
      register: droplet_inventory

    - debug: msg="{{ item|e - }}"
      with_items: "{{ droplet_inventory.stdout_lines}}"


output:

>
>> ok: [localhost] => (item=    10.128.164.13) => {
>
>     "item": "    10.128.164.13",
>
>     "msg": "    10.128.164.13"
>
> }
>
> ok: [localhost] => (item=    10.128.163.87) => {
>
>     "item": "    10.128.163.87",
>
>     "msg": "    10.128.163.87"
>
> }
>
> ok: [localhost] => (item=    10.128.163.89) => {
>
>     "item": "    10.128.163.89",
>
>     "msg": "    10.128.163.89"
>
> }
>
> ok: [localhost] => (item=    10.128.163.90) => {
>
>     "item": "    10.128.163.90",
>
>     "msg": "    10.128.163.90"
>
> }
>
>

How can I get rid of the leading whitespace? 

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6d78706b-3ab3-437c-b9b2-4efd941be971%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to