ansible_xlsx_inventory
ansible_xlsx_inventory copied to clipboard
Expected key=value host variable assignment, got: json
Hi
I am playing with your example files and I am getting mixed results. Some executions work and others do not. Is your excel "hard coded" to only accept certain combinations of columns? Can't I use for example, group by Sheet2 column B and host column Sheet 2 column E. If I do that I get an error however, if I follow the example in the description I don't.
I installed the requirements.txt in the venv environment and ran 2 commands.
-
./xlsx_inventory.py --config --file example.xlsx --hostname-col A --group-by-col B --sheet Sheet1 I get a Key Error! Is the sheet name setting correct? The config file looks correct tho so I continued.
-
ansible-inventory -i xlsx_inventory.py --list --yaml --output myinv.yml I get this: Inventory script had an execution error: Expected key=value host variable assignment, got json.
I want to be able to use any sheet and column for in the config file.
Thanks Rudi
It seems that if I change A inside cfg file "hostname_col = A" to something else like "hostname_col = B" the script breaks. However, I can choose any column for group_by_col abd sheet variable in the cfg file.