No Hosts Matched

Steps I took:

  1. New DO Server
  2. Installed lemp stack using Bedrock Ansible.
  3. Cloned Bedrock project, setup vagrant
  4. Setup ip address in group_vars/production and hosts/production.

I ran and got skipping: no hosts matched

1 Like

Please provide the exact command you ran.

Also try running the manual ansible-playbook command outside of

ansible-playbook -i hosts/production deploy.yml --extra-vars=""

Same error.

    local_path: '../' # path targeting local Bedrock project directory (relative to Ansible root)
    system_cron: true
      enabled: false
      subdomains: false
     enabled: false
    system_cron: true

@brandon Could you also post your host/production? Also post the full error message when you run with -vvvv. I’m wondering if it shows what host it tried to connect to, etc.



ansible-playbook -i hosts/production deploy.yml --extra-vars="" -vvvv

PLAY [Deploy WP site] ********************************************************* 
skipping: no hosts matched

PLAY RECAP ********************************************************************

What command did you use for provisioning the droplet initially? Assuming you used server.yml, I’m stumped as to how/why running server.yml would match a host but running deploy.yml would not match a host.

You can also run this to test inventory: ansible -i hosts/production --list-hosts all


This gave me:

1 Like

I used ansible-playbook -i hosts/production server.yml followed by ansible-playbook -i hosts/production secure-root.yml

And if you re-run ansible-playbook -i hosts/production server.yml --ask-sudo-pass -vvvv it does match a host?

(Now that you’ve run secure-root.yml, your server.yml will need sudo: Yes and remote_user: admin)

And I’m assuming you haven’t edited the hosts: web from deploy.yml (example).

And sorry to keep throwing random things out there, but have you tried completely rebuilding this remote server from scratch? If/when you try it, run secure-root.yml first, before server.yml. That’s been the more common sequence, but I doubt it should matter.

This allows me to run the command correctly. I tried rebuilding, running into the exact same issue. I haven’t edited the hosts in deploy.yml

I don’t pretend I’ve got a ton of experience, but this issue seems pretty unique, so my guess is that you’ve got some custom config that’s responsible. I’d probably start retracing steps, changing stuff back to defaults, testing along the way, trying to isolate any problematic customizations.

Maybe the first step could be testing a vanilla bedrock-ansible clone, to rule out potential issues with your environment. Good luck!

Thank you for your assistance though!