There was a mistake in the host file insted of using = i used :
that is the reason it was giving the error
thank you everyone for your response

On Tue, May 11, 2021 at 9:38 AM Komal Suthar <[email protected]>
wrote:

> Have you created the inventory file and also give the location of the
> inventory file in the ansible configuration file and also im ansible in
> think there are only 4 v's verbosity and we cant use this -vvvv with this
> inventory we can use this while we run a playbook.
>
> On Mon, May 10, 2021, 9:32 PM Suneel Hegde <[email protected]> wrote:
>
>> I tried that, but its still not working giving this error
>>
>> suneelkumar@LT- Ansible % ansible all --list-hosts -vvvvvvv
>> ansible 2.10.4
>>   config file =
>> /Users/suneelkumar/Documents/Automation/Ansible/ansible.cfg
>>   configured module search path =
>> ['/Users/suneelkumar/.ansible/plugins/modules',
>> '/usr/share/ansible/plugins/modules']
>>   ansible python module location =
>> /Library/Python/3.8/site-packages/ansible
>>   executable location = /usr/local/bin/ansible
>>   python version = 3.8.2 (default, Apr  8 2021, 23:19:18) [Clang 12.0.5
>> (clang-1205.0.22.9)]
>> Using /Users/suneelkumar/Documents/Automation/Ansible/ansible.cfg as
>> config file
>> setting up inventory plugins
>> host_list declined parsing
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts as it did not pass
>> its verify_file() method
>> auto declined parsing
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts as it did not pass
>> its verify_file() method
>> toml declined parsing
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts as it did not pass
>> its verify_file() method
>> [WARNING]:  * Failed to parse
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts with script plugin:
>> problem running /Users/suneelkumar/Documents/Automation/Ansible/hosts
>> --list ([Errno 8] Exec format error:
>> '/Users/suneelkumar/Documents/Automation/Ansible/hosts')
>>   File "/Library/Python/3.8/site-packages/ansible/inventory/manager.py",
>> line 289, in parse_source
>>     plugin.parse(self._inventory, self._loader, source, cache=cache)
>>   File
>> "/Library/Python/3.8/site-packages/ansible/plugins/inventory/script.py",
>> line 169, in parse
>>     raise AnsibleParserError(to_native(e))
>> [WARNING]:  * Failed to parse
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts with yaml plugin: We
>> were unable to read either as JSON nor YAML, these are the errors we got
>> from each: JSON: Expecting value: line 1 column 2 (char 1)  Syntax Error
>> while loading YAML.   expected '<document start>', but found '['  The error
>> appears to be in
>> '/Users/suneelkumar/Documents/Automation/Ansible/hosts': line 3, column
>> 1, but may be elsewhere in the file depending on the exact syntax problem.
>> The offending line appears to
>> be:   [ios:vars] ^ here
>>   File "/Library/Python/3.8/site-packages/ansible/inventory/manager.py",
>> line 289, in parse_source
>>     plugin.parse(self._inventory, self._loader, source, cache=cache)
>>   File
>> "/Library/Python/3.8/site-packages/ansible/plugins/inventory/yaml.py", line
>> 105, in parse
>>     raise AnsibleParserError(e)
>> [WARNING]:  * Failed to parse
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts with ini plugin:
>> /Users/suneelkumar/Documents/Automation/Ansible/hosts:10: Expected
>> key=value, got: ansible_connection: ansible.netcommon.network_cli
>>   File "/Library/Python/3.8/site-packages/ansible/inventory/manager.py",
>> line 289, in parse_source
>>     plugin.parse(self._inventory, self._loader, source, cache=cache)
>>   File
>> "/Library/Python/3.8/site-packages/ansible/plugins/inventory/ini.py", line
>> 138, in parse
>>     raise AnsibleParserError(e)
>> [WARNING]: Unable to parse
>> /Users/suneelkumar/Documents/Automation/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'
>>   hosts (0):
>> suneelkumar@LT- Ansible %
>>
>> On Mon, May 10, 2021 at 9:21 PM Matt Martz <[email protected]> wrote:
>>
>>> Your inventory seems to be configured literally as:
>>>
>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml
>>>
>>> Note that the # and everything after is still included as part of the
>>> path, where I assume you meant it to be a comment.
>>>
>>> Move the comment to its own line, and I would assume that it should
>>> start working for you.
>>>
>>> On Mon, May 10, 2021 at 10:45 AM Suneel Hegde <[email protected]>
>>> wrote:
>>>
>>>> Hello Team,
>>>>
>>>> I am trying to do ansible all --list-hosts -vvvvvvv and try to ping the
>>>> hosts but getting this error could you please help me to solve this 
>>>> problem?
>>>>
>>>> suneelkumar@LT Ansible % ansible all --list-hosts -vvvvvvv
>>>> ansible 2.10.4
>>>>   config file =
>>>> /Users/suneelkumar/Documents/Automation/Ansible/ansible.cfg
>>>>   configured module search path =
>>>> ['/Users/suneelkumar/.ansible/plugins/modules',
>>>> '/usr/share/ansible/plugins/modules']
>>>>   ansible python module location =
>>>> /Library/Python/3.8/site-packages/ansible
>>>>   executable location = /usr/local/bin/ansible
>>>>   python version = 3.8.2 (default, Apr  8 2021, 23:19:18) [Clang 12.0.5
>>>> (clang-1205.0.22.9)]
>>>> Using /Users/suneelkumar/Documents/Automation/Ansible/ansible.cfg as
>>>> config file
>>>> setting up inventory plugins
>>>> [WARNING]: Failed to load inventory plugin, skipping yml
>>>> host_list declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> script declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> auto declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> yaml declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> ini declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> toml declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> advanced_host_list declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> constructed declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> Skipping due to inventory source not existing or not being readable by
>>>> the current user
>>>> yaml declined parsing
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml as it did not
>>>> pass its verify_file() method
>>>> [WARNING]: Unable to parse
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml 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'
>>>>   hosts (0):
>>>> suneelkumar@LT Ansible %
>>>>
>>>> suneelkumar@LT Ansible % ansible all -m ping
>>>> [WARNING]: Failed to load inventory plugin, skipping yml
>>>> [WARNING]: Unable to parse
>>>> /Users/suneelkumar/Documents/Automation/Ansible/hosts
>>>>  #/Users/suneelkumar/Documents/Automation/Ansible/hosts.yaml 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'
>>>> suneelkumar@LT Ansible %
>>>>
>>>> I am running  ansible 2.10.4
>>>>
>>>> Thank you !
>>>>
>>>> regards,
>>>>
>>>> Suneel
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Ansible Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/CANuO0k7VyZXVTYSJ_iC3Bw4DTnzMDBm0mxKAUJkkWGk_z86Y0Q%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CANuO0k7VyZXVTYSJ_iC3Bw4DTnzMDBm0mxKAUJkkWGk_z86Y0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> Matt Martz
>>> @sivel
>>> sivel.net
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CAD8N0v_XpTig%2BOE01bLWJ1%2BT17r4Qq-uhvLoWv%2BtH3t5Z_d%3DwA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v_XpTig%2BOE01bLWJ1%2BT17r4Qq-uhvLoWv%2BtH3t5Z_d%3DwA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CANuO0k6VXg2D47DDFJVaL%3Dc7majrv4qv2M9CpepmdrpsFZtRwQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CANuO0k6VXg2D47DDFJVaL%3Dc7majrv4qv2M9CpepmdrpsFZtRwQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGgS%3DuUuLxD%3DaqWK9Bk3PXKQE9idDN5KoopUZbVbp2_sui%3D14w%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGgS%3DuUuLxD%3DaqWK9Bk3PXKQE9idDN5KoopUZbVbp2_sui%3D14w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CANuO0k5r4WOrb7RyMcqOzGY2c-HDCt_Xbiy9yuT1ydZyS_Fdtw%40mail.gmail.com.

Reply via email to