# Ansible commands are not working in a fresh Ubuntu installation

**URL:** <https://forum.ansible.com/t/ansible-commands-are-not-working-in-a-fresh-ubuntu-installation/20954>\
**Category:** Ansible Project\
**Tags:** ansible-project, ubuntu\
**Created:** [March 22, 2016, 2:40pm UTC](https://forum.ansible.com/t/ansible-commands-are-not-working-in-a-fresh-ubuntu-installation/20954 "2016-03-22T14:40:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Redling](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@Benjamin\_Redling](https://forum.ansible.com/u/Benjamin_Redling)\
**Post date:** [March 22, 2016, 2:40pm UTC](https://forum.ansible.com/t/ansible-commands-are-not-working-in-a-fresh-ubuntu-installation/20954/1 "2016-03-22T14:40:18Z")

</div>

> The installation was successful (I also tried an upgrade later). However  
> for some commands I run like "ansible -v", I get the following error and it  
> displays the help.
> 
> ERROR! Missing target hosts

Maybe you missed the first line were it shows you the syntax:  
$ ansible  
Usage: ansible \<host-pattern\> [options]  
...

> I had the same error for "ansible --list-hosts all". Then I enabled a host  
> entry in /etc/ansible/hosts, and that command is working, showing the host  
> I enabled.

Have you read the fine manual?  
[http://docs.ansible.com/ansible/intro\_getting\_started.html](http://docs.ansible.com/ansible/intro_getting_started.html)

> I am new to Ansible and following a guide that was based on Ansible 1.9.\*.  
> I understand that the current version is 2.\*. I tried to Google for a  
> solution but couldn't find anything useful.

A solution for what? It's all fine.  
The only problem is: you have to create a proper inventory file.  
s. link to the docs

Regards,  
Benjamin
