Ansible :Unable to parse /etc/ansible/hosts as an inventory source
up vote
1
down vote
favorite
I am new to ansible
, got the below issue.
I was able to ssh into my client machine .but unable to run playbook.
Getting the error below:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[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: a
here a is my group name. my hosts given below :
---------
[a]
172.31.26.93
[all:vars]
ansible_user=vagrant
ansible_ssh_pass=vagrant
ansible_ssh_host=172.31.26.93
ansible_ssh_port=22
ansible_ssh_user='ansibleuser'
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
------- my playbook file given below ----
- hosts: a
tasks:
- name: create a directory
file: path=/home/ansiblesuser/www state=directory
This is the first time I am getting this issue.
ssh error-handling ansible
|
show 1 more comment
up vote
1
down vote
favorite
I am new to ansible
, got the below issue.
I was able to ssh into my client machine .but unable to run playbook.
Getting the error below:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[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: a
here a is my group name. my hosts given below :
---------
[a]
172.31.26.93
[all:vars]
ansible_user=vagrant
ansible_ssh_pass=vagrant
ansible_ssh_host=172.31.26.93
ansible_ssh_port=22
ansible_ssh_user='ansibleuser'
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
------- my playbook file given below ----
- hosts: a
tasks:
- name: create a directory
file: path=/home/ansiblesuser/www state=directory
This is the first time I am getting this issue.
ssh error-handling ansible
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file usingansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Separately,ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as.ssh
inansibleuser
's home directory
– Matthew L Daniel
Nov 9 at 4:31
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31
|
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am new to ansible
, got the below issue.
I was able to ssh into my client machine .but unable to run playbook.
Getting the error below:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[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: a
here a is my group name. my hosts given below :
---------
[a]
172.31.26.93
[all:vars]
ansible_user=vagrant
ansible_ssh_pass=vagrant
ansible_ssh_host=172.31.26.93
ansible_ssh_port=22
ansible_ssh_user='ansibleuser'
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
------- my playbook file given below ----
- hosts: a
tasks:
- name: create a directory
file: path=/home/ansiblesuser/www state=directory
This is the first time I am getting this issue.
ssh error-handling ansible
I am new to ansible
, got the below issue.
I was able to ssh into my client machine .but unable to run playbook.
Getting the error below:
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[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: a
here a is my group name. my hosts given below :
---------
[a]
172.31.26.93
[all:vars]
ansible_user=vagrant
ansible_ssh_pass=vagrant
ansible_ssh_host=172.31.26.93
ansible_ssh_port=22
ansible_ssh_user='ansibleuser'
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
------- my playbook file given below ----
- hosts: a
tasks:
- name: create a directory
file: path=/home/ansiblesuser/www state=directory
This is the first time I am getting this issue.
ssh error-handling ansible
ssh error-handling ansible
edited Nov 8 at 13:26
kb-0
385
385
asked Nov 8 at 10:19
MANI KANTA
61
61
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file usingansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Separately,ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as.ssh
inansibleuser
's home directory
– Matthew L Daniel
Nov 9 at 4:31
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31
|
show 1 more comment
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file usingansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Separately,ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as.ssh
inansibleuser
's home directory
– Matthew L Daniel
Nov 9 at 4:31
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is
/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file using ansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is
/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file using ansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Separately,
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as .ssh
in ansibleuser
's home directory– Matthew L Daniel
Nov 9 at 4:31
Separately,
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as .ssh
in ansibleuser
's home directory– Matthew L Daniel
Nov 9 at 4:31
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205687%2fansible-unable-to-parse-etc-ansible-hosts-as-an-inventory-source%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hi Mani, welcome to SO! You didn't specify the file that contains your group name, nor the version of ansible you are using. Although if it is
/etc/ansible/hosts
and you have a modern version of ansible, you can check to see what ansible sees about that file usingansible-inventory -i /path/to/the/inventory/file --list
– Matthew L Daniel
Nov 9 at 4:30
Separately,
ansible_ssh_private_key_file=/home/ansibleuser/.ssh
is incorrect as that points to a directory, and not to a file -- unless you have for some terrible reason named your file as.ssh
inansibleuser
's home directory– Matthew L Daniel
Nov 9 at 4:31
love & respect for ur response.
– MANI KANTA
Nov 9 at 10:25
I changed the ssh_priavtekey_file to /home/ansibleuser/.ssh/id_rsa. and tried the the commond ansible-inventory -i /path/to/the/inventory/file --list , got below response ...
– MANI KANTA
Nov 9 at 10:26
{ "_meta": { "hostvars": { "172.31.26.93": { "ansible_ssh_host": "172.31.26.93", "ansible_ssh_pass": "vagrant", "ansible_ssh_port": 22, "ansible_ssh_private_key_file": "/home/ansibleuser/.ssh/id_rsa", "ansible_ssh_user": "ansibleuser", "ansible_user": "vagrant" } } }, "a": { "hosts": [ "172.31.26.93" ] }, "all": { "children": [ "a", "ungrouped" ] }, "ungrouped": {} }
– MANI KANTA
Nov 9 at 10:31