Created
          July 10, 2016 22:39 
        
      - 
      
- 
        Save andre-brongniart/175ac0518784f705cc388d970174b65d to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | - name: nsclient.ini-VM 32 bit | |
| win_copy: src=templates/win_generic/nsclient.ini-VM.j2 dest=C:\Program Files\NSClient++\nsclient.ini | |
| notify: restart nsclient 32 | |
| when: | |
| - ansible_os_family == "Windows" | |
| - host_type == "win_generic" | |
| - ansible_architecture == "32-bit" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Hi, I am having an issue when I try to run a play - I am attempting to copy a file on the control machine (raspi) to a Windows 10 PC.
Here is what my command looks like:
root@Raspi_Ctrl:/ansible/playbook# ansible-playbook /ansible/playbook/win_copy.yml
Here is my result:
ERROR! 'when' is not a valid attribute for a Play
The error appears to have been in '/ansible/playbook/win_copy.yml': line 14, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
^ here
This is my win_copy.yml file:
win_copy: src=/ansible/ansible.cfg dest=C:\Users\Machine\Desktop
notify: restart nsclient 32
when:
- ansible_os_family == "Windows"
- host_type == "win_generic"
Can you tell me what I am doing incorrectly? I am also trying to figure out how to specify my target machine from the hosts file.