Hi,
We have huge list of servers in excel sheet i want to import the inventory from excel sheet and want to sacn a particular directory to fech the file details and create the excel sheet with the results is it possible anyone can give me th idea on this . And we don’t have db yet to maintain inventory. We are usinv AWX to run the playbook running on k8 cluster
If you have AWX you have a database to manage inventory in 2 forms. The AWX user interface lets you create an inventory via API or just pointing, clicking, and typing. In theory you could import the information in your spreadsheet into an inventory in the UI. This likely would be a single event and then you’d want to switch over to trusting the inventory information in Ansible.
Additionally; you can keep an inventory in an SCM like a git forge (GitHub, GitLab, Gitea, Git on a Linux box with SSH - Git SCM book has examples).
I’d encourage you to get away from interacting with Excel sheets stored on disks as quickly as possible. Especially in AWX it gets harder to put the Excel sheet somewhere the container executing the job can reach it (volumes mounted to all job containers, an external execution node that is a VM with a traditional shared drive that is also mounted into job containers). These difficulties go both ways; reading a file for inventory information and saving information out as a report. In the reporting out scenario you can get the file out a few ways like EMAIL or uploading it to Sharepoint. Even then though AWX will be logging the job events and there are other systems that aid in getting job log data off of the AWX box for longer term storage like syslog / splunk or a custom callback plugin.
I would do as @wayt suggests, there is an inventory script that would allow you to import the inventory from excel easily GitHub - KeyboardInterrupt/ansible_xlsx_inventory: Turn any Excel Sheet into an Ansible Inventory