# Ansible 2.3 devel - ansible-playbook command failing with error for ansible command

**URL:** <https://forum.ansible.com/t/ansible-2-3-devel-ansible-playbook-command-failing-with-error-for-ansible-command/23809>\
**Category:** Ansible Developer\
**Created:** [February 24, 2017, 4:45pm UTC](https://forum.ansible.com/t/ansible-2-3-devel-ansible-playbook-command-failing-with-error-for-ansible-command/23809 "2017-02-24T16:45:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dwarika\_Prasad](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Dwarika\_Prasad](https://forum.ansible.com/u/Dwarika_Prasad)\
**Post date:** [February 24, 2017, 4:45pm UTC](https://forum.ansible.com/t/ansible-2-3-devel-ansible-playbook-command-failing-with-error-for-ansible-command/23809/1 "2017-02-24T16:45:49Z")

</div>

Hi,

I just upgraded to ansible 2.3 , taking the code from git. Now I am not able to run the same command which was working earlier with ansible 2.2.

Please find below the error -

stock]$ **ansible-playbook -i inventory.hosts tasks/main.yml**  
**Usage: ansible** [options]

Options:  
-a MODULE\_ARGS, --args=MODULE\_ARGS  
module arguments  
–ask-vault-pass ask for vault password  
-B SECONDS, --background=SECONDS  
run asynchronously, failing after X seconds  
(default=N/A)  
-C, --check don’t make any changes; instead, try to predict some  
of the changes that may occur  
-D, --diff when changing (small) files and templates, show the  
differences in those files; works great with --check  
-e EXTRA\_VARS, --extra-vars=EXTRA\_VARS  
set additional variables as key=value or YAML/JSON  
-f FORKS, --forks=FORKS  
specify number of parallel processes to use  
(default=5)  
-h, --help show this help message and exit  
-i INVENTORY, --inventory-file=INVENTORY  
specify inventory host path  
(default=/etc/ansible/hosts) or comma separated host  
list.  
-l SUBSET, --limit=SUBSET  
further limit selected hosts to an additional pattern  
–list-hosts outputs a list of matching hosts; does not execute  
anything else  
-m MODULE\_NAME, --module-name=MODULE\_NAME  
module name to execute (default=command)  
-M MODULE\_PATH, --module-path=MODULE\_PATH  
specify path(s) to module library (default=None)  
–new-vault-password-file=NEW\_VAULT\_PASSWORD\_FILE  
new vault password file for rekey  
-o, --one-line condense output  
–output=OUTPUT\_FILE output file name for encrypt or decrypt; use - for  
stdout  
-P POLL\_INTERVAL, --poll=POLL\_INTERVAL  
set the poll interval if using -B (default=15)  
–syntax-check perform a syntax check on the playbook, but do not  
execute it  
-t TREE, --tree=TREE log output to this directory  
–vault-password-file=VAULT\_PASSWORD\_FILE  
vault password file  
-v, --verbose verbose mode (-vvv for more, -vvvv to enable  
connection debugging)  
–version show program’s version number and exit

Connection Options:  
control as whom and how to connect to hosts

-k, --ask-pass ask for connection password  
–private-key=PRIVATE\_KEY\_FILE, --key-file=PRIVATE\_KEY\_FILE  
use this file to authenticate the connection  
-u REMOTE\_USER, --user=REMOTE\_USER  
connect as this user (default=None)  
-c CONNECTION, --connection=CONNECTION  
connection type to use (default=smart)  
-T TIMEOUT, --timeout=TIMEOUT  
override the connection timeout in seconds  
(default=10)  
–ssh-common-args=SSH\_COMMON\_ARGS  
specify common arguments to pass to sftp/scp/ssh (e.g.  
ProxyCommand)  
–sftp-extra-args=SFTP\_EXTRA\_ARGS  
specify extra arguments to pass to sftp only (e.g. -f,  
-l)  
–scp-extra-args=SCP\_EXTRA\_ARGS  
specify extra arguments to pass to scp only (e.g. -l)  
–ssh-extra-args=SSH\_EXTRA\_ARGS  
specify extra arguments to pass to ssh only (e.g. -R)

Privilege Escalation Options:  
control how and which user you become as on target hosts

-s, --sudo run operations with sudo (nopasswd) (deprecated, use  
become)  
-U SUDO\_USER, --sudo-user=SUDO\_USER  
desired sudo user (default=root) (deprecated, use  
become)  
-S, --su run operations with su (deprecated, use become)  
-R SU\_USER, --su-user=SU\_USER  
run operations with su as this user (default=root)  
(deprecated, use become)  
-b, --become run operations with become (does not imply password  
prompting)  
–become-method=BECOME\_METHOD  
privilege escalation method to use (default=sudo),  
valid choices: [ sudo | su | pbrun | pfexec | doas |  
dzdo | ksu | runas ]  
–become-user=BECOME\_USER  
run operations as this user (default=root)  
–ask-sudo-pass ask for sudo password (deprecated, use become)  
–ask-su-pass ask for su password (deprecated, use become)  
-K, --ask-become-pass  
ask for privilege escalation password  
**ERROR! Missing target hosts**

Please resolve asap.

Regards,  
Dwarika

---

<div class="post-metadata">

**Author:** ![jordan\_white](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jordan\_white](https://forum.ansible.com/u/jordan_white)\
**Post date:** [February 26, 2017, 2:33am UTC](https://forum.ansible.com/t/ansible-2-3-devel-ansible-playbook-command-failing-with-error-for-ansible-command/23809/2 "2017-02-26T02:33:29Z")

</div>

You may want to look at this ticket. [https://github.com/ansible/ansible/issues/21850](https://github.com/ansible/ansible/issues/21850). The user had the same issue as you, but it was caused by him mixing up his repo with his clone of Ansible’s repo. Here is another issue that might cause it, [http://serverfault.com/questions/800565/ansible-error-missing-target-hosts](http://serverfault.com/questions/800565/ansible-error-missing-target-hosts). I just downloaded the latest development version and was unable to reproduce the problem. Hope one of those links helps. Best of luck.

- Jordan White

---

<div class="post-metadata">

**Author:** ![jordan\_white](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jordan\_white](https://forum.ansible.com/u/jordan_white)\
**Post date:** [February 27, 2017, 6:04am UTC](https://forum.ansible.com/t/ansible-2-3-devel-ansible-playbook-command-failing-with-error-for-ansible-command/23809/3 "2017-02-27T06:04:41Z")

</div>

Just one more thought. Based off of another message I saw (don’t remember which one), if you upgraded from 2.2 to 2.3 using a pull, changes in the directory structure and the .gitignore file may cause some issues. I’ve personally upgraded from 2.2.X to 2.3 using pull and didn’t have issues, but it might be worth deleting your copy and re-cloning.
