# Unable to execute ansible-playbook (when using shebang header with multiple options)

**URL:** <https://forum.ansible.com/t/unable-to-execute-ansible-playbook-when-using-shebang-header-with-multiple-options/12944>\
**Category:** Ansible Project\
**Created:** [June 11, 2013, 1:22pm UTC](https://forum.ansible.com/t/unable-to-execute-ansible-playbook-when-using-shebang-header-with-multiple-options/12944 "2013-06-11T13:22:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rabbit](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@rabbit](https://forum.ansible.com/u/rabbit)\
**Post date:** [June 11, 2013, 1:22pm UTC](https://forum.ansible.com/t/unable-to-execute-ansible-playbook-when-using-shebang-header-with-multiple-options/12944/1 "2013-06-11T13:22:52Z")

</div>

Hi guys,

When I executing ansible-playbook command manually it works like a charm:

$ _ansible-playbook --inventory-file=…/hosts --private-key=/root/.ssh/ansible.private.key test.yml_

_PLAY [fakegroup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_

_GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_ok: [[fakehost.example.org](http://fakehost.example.org)]_

_TASK: [fake ansible task] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_changed: [[fakehost.example.org](http://fakehost.example.org)]_

_PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_[fakehost.example.org](http://fakehost.example.org) : ok=2 changed=1 unreachable=0 failed=0_

But when I edit playbook and add a shebang header of the same command as above it fails:

_$_ _./test.yml_  
_ERROR: Unable to find an inventory file, specify one with -i ?_

Here is an example of my playbook:  
_$_ _cat test.yml_  
#!/usr/bin/ansible-playbook --inventory-file=…/hosts --private-key=/root/.ssh/ansible.private.key
