and when i run playbook # ansible-playbook -i Inventories/production, it doesn't picks the inventory details.
Currently my inventory is
|----Inventories
| |-----group_vars
| | |---production
| |-----Inventory1
| |-----Production
|----Playbooks
| |-----test.yml
|-----roles
| |-----copy_template
| |-----tasks/main.yml
|-----templates/copy.js.j2
#Inventories/inventory1
[smtp]
server1 ansible_ssh_host=
server1.cloudapp.net ansible_ssh_port=22
server2 ansible_ssh_host=
server1.cloudapp.net ansible_ssh_port=23
[smtp:vars]
ansible_ssh_user=testuser
ansible_ssh_private_key_file=/home/testuser/smtp-key.pem
#Inventories/production
---
[smtp]
#Playbooks/test.yml
---
- hosts: "{{ hosts }}"
remote_user: testuser
sudo: yes
roles:
- copy_template
#roles/copy_template/tasks/main.yml
---
- name: Upload config file
template: src=copy.js.j2 dest=/home/testuser/test.js owner=root mode=0664
sudo: true
#roles/copy_template/templates/copy.js.j2
// Configuration parameters
var environment = '{{env}}';
var url = '{{url}}';
I run the playbook using # ansible-playbook -i Inventories/production Playbooks/test.yml --extra-vars "hosts=smtp"
But no hosts matched in my case. Can you please help