# Running Ansible playbook using AWS Systems Manager (skipping: no hosts matched)

**URL:** <https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 8, 2022, 3:13pm UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702 "2022-06-08T15:13:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasanth\_S\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Prasanth\_S\_Nair](https://forum.ansible.com/u/Prasanth_S_Nair)\
**Post date:** [June 8, 2022, 3:13pm UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/1 "2022-06-08T15:13:00Z")

</div>

Hi All,

I’m not sure this is the right place to ask this question.

I’m trying to run an ansible playbook from Github using AWS Systems Manager. My repo has a hosts (ini format) file as shown below:

_[dev] [server.example.com](http://server.example.com)_

And my playbook looks like below:

_— - name: test run_

_hosts: dev_

_become: true_

When I run the playbook, I get the error below:

PLAY [test run] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* skipping: no hosts matched

Any idea why it is not picking up the hosts? Can someone help me to resolve this issue?

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [June 8, 2022, 6:58pm UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/2 "2022-06-08T18:58:23Z")

</div>

> Hi All,
> 
> I’m not sure this is the right place to ask this question.
> 
> I’m trying to run an ansible playbook from Github using AWS Systems Manager. My repo has a hosts (ini format) file as shown below:
> 
> _[dev] [server.example.com](http://server.example.com)_
> 
> And my playbook looks like below:
> 
> _— - name: test run_
> 
> _hosts: dev_
> 
> _become: true_

This isn’t valid nor complete.  
Please provide the entire playbook using a correct formatting

---

<div class="post-metadata">

**Author:** ![Prasanth\_S\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Prasanth\_S\_Nair](https://forum.ansible.com/u/Prasanth_S_Nair)\
**Post date:** [June 9, 2022, 2:14pm UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/3 "2022-06-09T14:14:24Z")

</div>

Hi Dick,

Thank you for your reply. This is the Git repo [https://github.com/prasanthcambridge/ansible](https://github.com/prasanthcambridge/ansible)

Basically, I’m running the Ansible playbook from the AWS Systems Manager Console → Run command → AWS-ApplyAnsiblePlaybooks → Specify the Github repo location → Choose the target instances → Run.

It works fine if I change ‘hosts: all’ in the playbook instead of the group name ‘dev’. But, I just only want to run against a group.

Is there anything I’m doing wrong here? I’m very new to Ansible.

Kind regards,  
Prasanth

---

<div class="post-metadata">

**Author:** ![Prasanth\_S\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Prasanth\_S\_Nair](https://forum.ansible.com/u/Prasanth_S_Nair)\
**Post date:** [June 10, 2022, 8:49am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/4 "2022-06-10T08:49:33Z")

</div>

Hi Dick.

I also get the below warning message:

[WARNING]: Could not match supplied host pattern, ignoring: dev

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [June 10, 2022, 8:52am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/5 "2022-06-10T08:52:56Z")

</div>

> Hi Dick.
> 
> I also get the below warning message:
> 
> [WARNING]: Could not match supplied host pattern, ignoring: dev

Where did you define that host group?

Regards

```
         Racke

```

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [June 10, 2022, 10:13am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/6 "2022-06-10T10:13:49Z")

</div>

> Hi All,
> 
> I’m not sure this is the right place to ask this question.
> 
> I’m trying to run an ansible playbook from Github using AWS Systems Manager. My repo has a hosts (ini format) file as shown below:
> 
> _[dev] [server.example.com](http://server.example.com)_

This should not be on one line

---

<div class="post-metadata">

**Author:** ![Prasanth\_S\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Prasanth\_S\_Nair](https://forum.ansible.com/u/Prasanth_S_Nair)\
**Post date:** [June 10, 2022, 10:40am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/7 "2022-06-10T10:40:13Z")

</div>

Hi Racke,

It is defined under hosts file. Please see the links below:

[https://github.com/prasanthcambridge/ansible](https://github.com/prasanthcambridge/ansible)  
[https://stackoverflow.com/questions/72547240/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched](https://stackoverflow.com/questions/72547240/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched)

Kind regards,  
Prasanth

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [June 10, 2022, 11:40am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/8 "2022-06-10T11:40:25Z")

</div>

> Hi Racke,
> 
> It is defined under hosts file. Please see the links below:
> 
> [https://github.com/prasanthcambridge/ansible](https://github.com/prasanthcambridge/ansible)  
> [https://stackoverflow.com/questions/72547240/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched](https://stackoverflow.com/questions/72547240/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched)
> 
> Kind regards,  
> Prasanth

Hello Pransath,

you are using -i localhost in the playbook command, maybe that's the problem?

Regards

```
        Racke

```

---

<div class="post-metadata">

**Author:** ![Prasanth\_S\_Nair](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Prasanth\_S\_Nair](https://forum.ansible.com/u/Prasanth_S_Nair)\
**Post date:** [June 13, 2022, 9:07am UTC](https://forum.ansible.com/t/running-ansible-playbook-using-aws-systems-manager-skipping-no-hosts-matched/36702/9 "2022-06-13T09:07:59Z")

</div>

Hi Racke,

Thank you for your reply. Looks like that causes the issue. Let me do some troubleshooting and will get back to you.

Kind regards,  
Prasanth
