Hi ,
As i have created two simple playbook to remove file from window system and create the file on window system.
But getting error while i execute the both playbook. (Ansible controller version is 2.9)
1. remove_file.yml
---
- name: remove a file (check mode)
hosts: win
win_package:
path: C:\ansible_wu.txt
state: absent
register: remove_file_check
check_mode: yes
***************************************************
Error-
***************************************************
ERROR! 'win_package' is not a valid attribute for a Play
The error appears to be in '/home/ansible/rx_testing/win_remove_file.yml': line 2, column 4, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: remove a file (check mode)
^ here
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2. touch.yml
---
- hosts: win
name: Create the file
win_file:
path: C:\amit.txt
state: touch
_________________
Error
------------------------------
ERROR! 'win_file' is not a valid attribute for a Play
The error appears to be in '/home/ansible/rx_testing/win_touch.yml': line 2, column 4, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- hosts: win
^ here
*************************************************************************
Regards
Amit