# Running the Following Playbook syntax appears to be correct but getting following ERROR!-  ERROR! 'blockinfile' is not a valid attribute for a Play

**URL:** <https://forum.ansible.com/t/running-the-following-playbook-syntax-appears-to-be-correct-but-getting-following-error-error-blockinfile-is-not-a-valid-attribute-for-a-play/21085>\
**Category:** Ansible Project\
**Created:** [April 7, 2016, 7:03am UTC](https://forum.ansible.com/t/running-the-following-playbook-syntax-appears-to-be-correct-but-getting-following-error-error-blockinfile-is-not-a-valid-attribute-for-a-play/21085 "2016-04-07T07:03:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Veeragoni](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Karthik\_Veeragoni](https://forum.ansible.com/u/Karthik_Veeragoni)\
**Post date:** [April 7, 2016, 7:03am UTC](https://forum.ansible.com/t/running-the-following-playbook-syntax-appears-to-be-correct-but-getting-following-error-error-blockinfile-is-not-a-valid-attribute-for-a-play/21085/1 "2016-04-07T07:03:40Z")

</div>

`

```auto
ERROR! 'blockinfile' is not a valid attribute for a Play

The error appears to have been in '/root/playbook1.yml': line 2, column 3, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: insertupdate
  ^ here

```

`

I am Using Ansible Version 2.x

My Playbook file code is:

```auto
---
- name: insertupdate
  blockinfile:
    dest: /etc/network/interfaces
    block: |
      iface eth2 inet static
          address 192.168.0.1
          netmask 255.255.255.0 

```
