# pre-task attribute error

**URL:** <https://forum.ansible.com/t/pre-task-attribute-error/18967>\
**Category:** Ansible Project\
**Created:** [August 7, 2015, 10:50am UTC](https://forum.ansible.com/t/pre-task-attribute-error/18967 "2015-08-07T10:50:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iacopo\_carraro](https://avatars.discourse-cdn.com/v4/letter/i/41988e/32.png) [@iacopo\_carraro](https://forum.ansible.com/u/iacopo_carraro)\
**Post date:** [August 7, 2015, 10:50am UTC](https://forum.ansible.com/t/pre-task-attribute-error/18967/1 "2015-08-07T10:50:23Z")

</div>

Hello there,  
i’m trying to include a yml file as a pre-task in my playbook. The problem is i can’t pass custom parameters to it.  
Here is my code:

```auto

pre_tasks:
- { include: includes/notifications-start.yml, msg: my-msg }

```

`my-message` is a simple string, not a variable and also `msg` is not used in any other place.  
Here is the error i see when i run the playbook:

```auto
$ ansible-playbook -i hosts/staginghosts web_deploy.yml

ERROR! 'msg' is not a valid attribute for a Task

The error appears to have been in '/path/to/my/repo/ansible/web_deploy.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

pre_tasks:
- { include: includes/notifications-start.yml, msg: my-task-name }
^ here

```

It appears that i can’t add any custom variable name there.  
Ansible version:

```auto

$ ansible --version
ansible 2.0.0 (devel e8452c864e) last updated 2015/08/06 17:23:42 (GMT +200)
lib/ansible/modules/core: (detached HEAD 016b4ede2e) last updated 2015/08/06 17:23:45 (GMT +200)
lib/ansible/modules/extras: (detached HEAD 210ee3febc) last updated 2015/08/06 17:23:45 (GMT +200)
v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/08/06 17:24:03 (GMT +200)
v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/08/06 17:24:21 (GMT +200)
config file =
configured module search path = None

```

Thanks
