Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected key=value host variable assignment, got: json #14

Open
rudimocnik opened this issue Sep 14, 2020 · 1 comment
Open

Expected key=value host variable assignment, got: json #14

rudimocnik opened this issue Sep 14, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rudimocnik
Copy link

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.

  1. ./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.

  2. 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

@rudimocnik
Copy link
Author

rudimocnik commented Sep 15, 2020

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.

@KeyboardInterrupt KeyboardInterrupt self-assigned this Aug 8, 2021
@KeyboardInterrupt KeyboardInterrupt added the bug Something isn't working label Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants