On 3/19/20 9:22 AM, Uppara venkat wrote:
> Hi all,
> 
> I have written below task to copy a file if it is 64-bit windows OS. 
> 
> - name:
>   win_shell: 'wmic os get osarchitecture |  findstr "bit"'
>   register: result
> - debug: var=result.stdout_lines  
> 
> - name:
>   win_copy:
>    src='{{package_PATH}}/vim25.zip'
>    dest='{{ vim25_PATH }}/vmware/'
>    remote_src=yes
>   when: result.stdout_lines == '64-bit'
> 
> while executing  task it's skipping even condition is true.
> 
> out put as below:
> 
> skipping: [172.31.27.224] => {
>     "changed": false,
>     "skip_reason": "Conditional result was False"
> }
> 
> Can any one help me to fix this issue?

1. use Ansible facts to determine OS details (ansible_architecture)
2. stdout_lines is a list so a string match is futile, try stdout or 
stdout_lines[0]

Regards
        Racke

> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAFMhZ_%2B4oF0BD10fcX_3r-CnsNvsV%3DRT2h7_wSAnu%2BBkBmT%3Dug%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAFMhZ_%2B4oF0BD10fcX_3r-CnsNvsV%3DRT2h7_wSAnu%2BBkBmT%3Dug%40mail.gmail.com?utm_medium=email&utm_source=footer>.


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-- 
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/215b8665-24a8-0d01-7f8c-3d1343db21c9%40linuxia.de.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to