Hello all,
    I am trying to do a conditional based on the output of a win_shell.  
When I run this it's as if it doesn't see the conditional and copies to to 
all inventory not just what is coming back as True.  Any ideas?

- hosts: all
  - name: Run multi-lined shell commands
    win_shell: |
if (Test-Path “HKLM:\Software\Microsoft\Microsoft SQL Server\Instance 
Names\SQL”) { write-host “True” } Else { write-host “False” }
    register: results
  - name: Process win_shell output
      output: "{{ results.stdout }}" 
  -  win_copy:
       src: files/
       dest: c:\support
       When: ansible_facts['results.stdout'] == "True"

You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to