# \[Help\] Could not match supplied host pattern

**URL:** <https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052>\
**Category:** Ansible Project\
**Created:** [July 15, 2018, 6:35pm UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052 "2018-07-15T18:35:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deanosim](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Deanosim](https://forum.ansible.com/u/Deanosim)\
**Post date:** [July 15, 2018, 6:35pm UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/1 "2018-07-15T18:35:42Z")

</div>

I’m learning Ansible and other things from this guide [https://github.com/Artemmkin/infrastructure-as-code-tutorial/blob/master/docs/06-ansible.md](https://github.com/Artemmkin/infrastructure-as-code-tutorial/blob/master/docs/06-ansible.md)  
Only problem is whenever I try and run deply.yml I get

`

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match  
‘all’

[WARNING]: Could not match supplied host pattern, ignoring: raddit-app

PLAY [Deploy Raddit App] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: no hosts matched

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

`

I know this is probably caused by the fact the guide was written for 2.4 of Ansible but I’d like to update it to use 2.6 aka the latest.

I can post my hosts.yml deply.yml and ansiblecfg if needed, but all that same info is in the guide I linked.

Any help would be very much appreciated as I’m a noob when It comes to Ansible and I really want to learn it better.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 15, 2018, 7:21pm UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/2 "2018-07-15T19:21:22Z")

</div>

> I'm learning Ansible and other things from this guide  
> [https://github.com/Artemmkin/infrastructure-as-code-tutorial/blob/master/docs/06-ansible.md](https://github.com/Artemmkin/infrastructure-as-code-tutorial/blob/master/docs/06-ansible.md)  
> Only problem is whenever I try and run deply.yml I get  
> [WARNING]: provided hosts list is empty, only localhost is available. Note  
> that the implicit localhost does not match  
> 'all'
> 
> [WARNING]: Could not match supplied host pattern, ignoring: raddit-app
> 
> PLAY [Deploy Raddit App]  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: no hosts matched
> 
> PLAY RECAP  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> I know this is probably caused by the fact the guide was written for 2.4 of  
> Ansible but I'd like to update it to use 2.6 aka the latest.

I highly doubt it since this part haven't change for many versions.

> I can post my hosts.yml deply.yml and ansiblecfg if needed, but all that  
> same info is in the guide I linked.

You would need to, if not we are left to speculate and guess and that is not very productive.

> Any help would be very much appreciated as I'm a noob when It comes to  
> Ansible and I really want to learn it better.

The important thing when you need help is to provide as much information that you can.  
A little to much information is better then to little.

---

<div class="post-metadata">

**Author:** ![Deanosim](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Deanosim](https://forum.ansible.com/u/Deanosim)\
**Post date:** [July 16, 2018, 7:10am UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/3 "2018-07-16T07:10:42Z")

</div>

ansible.cfg  
`

[defaults]  
inventory = ./hosts.yml  
private\_key\_file = ~/.ssh/raddit-user  
host\_key\_checking = False

`

deploy.yml  
`

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 16, 2018, 8:33am UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/4 "2018-07-16T08:33:01Z")

</div>

You are missing a colon after raddit-instance.

---

<div class="post-metadata">

**Author:** ![Deanosim](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Deanosim](https://forum.ansible.com/u/Deanosim)\
**Post date:** [July 16, 2018, 9:02am UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/5 "2018-07-16T09:02:03Z")

</div>

Ohhhh, this is why you don’t do this after 2am at night XD.

Sadly it’s still giving me that error even after I added the colon :/, clearly I’m missing something still

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 16, 2018, 9:56am UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/6 "2018-07-16T09:56:39Z")

</div>

If all three files is in the same directory and you are in that directory when running "ansible-playbook deploy.yml" it should work.

---

<div class="post-metadata">

**Author:** ![Deanosim](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Deanosim](https://forum.ansible.com/u/Deanosim)\
**Post date:** [July 16, 2018, 10:02am UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/7 "2018-07-16T10:02:08Z")

</div>

Yeah all files are in the same directory and I’m running it from that directory.  
Yet for some odd reason it’s still giving me that error, I’m wondering if I should setup a fresh vm with ansible to test it on that.  
The error again just to show it’s the same

`

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

[WARNING]: Could not match supplied host pattern, ignoring: raddit-app

PLAY [Deploy Raddit App] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: no hosts matched

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

`

---

<div class="post-metadata">

**Author:** ![Deanosim](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Deanosim](https://forum.ansible.com/u/Deanosim)\
**Post date:** [July 16, 2018, 1:26pm UTC](https://forum.ansible.com/t/help-could-not-match-supplied-host-pattern/28052/8 "2018-07-16T13:26:52Z")

</div>

Okay I manged to get it to work, For some reason on the ubuntu 18.04 version of windows subsystem for linux it just doesn’t work, but in a VM of ubuntu 18.04 it works fine
