I tried that, but its still not working giving this error
suneelkumar@LT- Ansible % ansible all --list-hosts -vvvvvvv
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