You have syntax errors. I recommend using a site like yamllint.com to make
sure your playbooks are valid yaml when you are first getting used to
ansible syntax.
Try this instead
---
- name: database playbook
hosts: db
tasks:
- name: ensure cloning directory exists
file:
path: /home/ansible/cloning
state: directory
On Tuesday, January 16, 2018 at 1:06:49 PM UTC, Pranay Nanda wrote:
>
> what's wrong with this?
>
> ---- hosts: db tasks: - file: - path: /home/ansible/cloning - state:
> directory name: "create directory"
> It gives an error:ERROR! unexpected parameter type in action: <class
> 'ansible.parsing.yaml.objects.AnsibleSequence'>The error appears to have
> been in '/home/ansible/playbooks/clone.yml': line 4, column 7, but maybe
> elsewhere in the file depending on the exact syntax problem.The offending
> line appears to be: tasks: - file: ^ hereThe error appears to have been
> in '/home/ansible/playbooks/clone.yml': line 4, column 7, but maybe
> elsewhere in the file depending on the exact syntax problem.The offending
> line appears to be: tasks: - file: ^ hereexception type: <class
> 'ansible.errors.AnsibleParserError'>exception: unexpected parameter type
> in action: <class 'ansible.parsing.yaml.objects.AnsibleSequence'>The
> error appears to have been in '/home/ansible/playbooks/clone.yml': line 4,
> column 7, but maybe elsewhere in the file depending on the exact syntax
> problem.The offending line appears to be: tasks: - file: ^ here
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.