DeeJay
DeeJay

Reputation: 1

Ansible task fails when executed manually with: "skipping: no hosts matched"

I am trying to follow along with a DevOps book (for SharePoint), it describes a way to provision different environments (dev,prod,test) by using vagrant and ansible together an automated, repeatable way to provision multiple boxes for the virtualbox virtualization provider.

ansible --version output:

ansible 2.7.8
  config file = /Users/username/Desktop/projects/vagrant-ansible-packer-spfarm/ansible.cfg
  configured module search path = [u'/Users/username/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.15 (default, Feb 12 2019, 11:44:53) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)

I managed to take the first steps, set up the project, provision the one and only DomainController by using the github repo on my mac.

As a next step I would like to execute an ansible task manually by using the ansible CLI to apply some settings on my local deployment (DC) :

ansible-playbook -i ansible/test.ini ansible/plays/domaincontroller.yaml --extra-vars="ansible_user='[email protected]' ansible_password='Pass@wordX!'" --start-at-task="add admin account to Domain Admins group" -vvvvv

As a result i constantly get this skipping: no hosts matched

This is my directory structure and the origin of this project.

Ansible is new to me. I really like how it contributes to the DevOps concept. But I am really struggling on this one, so any help coming from you dev guys would be appreicated! If you need further information to help me out with this issue please do not hesitate to contact me!

Update: I already tried to whitelist the plugins in my ansible.cfg acording to the ansible documentation, but it did not work for me :( ansible docfile link: https://docs.ansible.com/ansible/2.7/plugins/inventory.html

Upvotes: 0

Views: 566

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68239

As per Ansible documentation:

Group names are case sensitive.

Your play defaults host directive to DomainControllers, whereas in the test.ini inventory you have domaincontrollers group.

Change something of this, or pass additional extra variable -e cloud_host=domaincontrollers

Upvotes: 1

Related Questions