I pulled down ansible via git repository to create an RPM via:
$ git clone git://
github.com/ansible/ansible.git --recursive
$ cd ./ansible
$ git pull --rebase
However, I did not do the following:
$ git submodule update --init --recursive
From the section
http://docs.ansible.com/ansible/intro_installation.html#running-from-source:
"Note when updating ansible, be sure to not only update the source tree,
but also the “submodules” in git which point at Ansible’s own modules
(not the same kind of modules, alas)."
After performing the above, then building and installing the RPM, the blockinfile module works.
$ make rpm
$ sudo rpm -Uvh ./rpm-build/ansible-*.noarch.rpm
Hopefully this helps someone else, too.