I am new to ansible getting error
ansible-playbook -vvvv -i apphosts file.yml
ERROR: parse error: playbooks must be formatted as a YAML list, got <type ‘dict’>
tasks:
-
name: Check that the somefile.conf exists
stat: path=/etc/file.txt
register: stat_result -
name: Create the file, if it doesnt exist already
file: path=/etc/file.txt state=touch
when: stat_result.stat.exists == False
can any one please help me to sort this problem