Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-16 Thread sk32...@gmail.com
So what is the proper way of configuring the dynamic inventory plugin in the ansible-config ? my ansible.cfg looks as follows. [inventory] # List of enabled inventory plugins and the order in which they are used. enable_plugins = auto, yaml # Ignore these extensions when parsing a directory as

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread sameer khan
I am running it as sudo, On Wed, Oct 14, 2020 at 5:54 AM prajwal wrote: > Try to run with the sudo command > > On Wed, 14 Oct, 2020, 2:51 pm sk32...@gmail.com, > wrote: > >> yep I did chmod a+x get_branch.py >> >> no luck with that too and I did the same to the config file as well, >> >> On We

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread prajwal
Try to run with the sudo command On Wed, 14 Oct, 2020, 2:51 pm sk32...@gmail.com, wrote: > yep I did chmod a+x get_branch.py > > no luck with that too and I did the same to the config file as well, > > On Wednesday, October 14, 2020 at 5:13:08 AM UTC-4 dick@geant.org > wrote: > >> ah i think

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread sk32...@gmail.com
yep I did chmod a+x get_branch.py no luck with that too and I did the same to the config file as well, On Wednesday, October 14, 2020 at 5:13:08 AM UTC-4 dick@geant.org wrote: > ah i think i see, the inventory script needs to be executable - can > you check that? > > On Wed, 14 Oct 2020 at

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread Dick Visser
ah i think i see, the inventory script needs to be executable - can you check that? On Wed, 14 Oct 2020 at 11:04, sk32...@gmail.com wrote: > > It starts with a shebang, and it is parsing a .ini config file, below is the > code, > > #!/usr/bin/env python3 > > import os > import sys > import argpa

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread sk32...@gmail.com
https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/plugins/inventory/script.py #L161 this line does it expects a precise format, as the script is returning a precise json format, not sure what I am doing wrong, to have that exception raised, I have given a proper file path, ansib

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread sk32...@gmail.com
It starts with a shebang, and it is parsing a .ini config file, below is the code, #!/usr/bin/env python3 import os import sys import argparse import json import logging import configparser import re try: import ldap3 except ImportError: print('Could not import \'ldap3\' module.') print('Please

Re: [ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread Dick Visser
Maybe the python environments are different between the manually run script and the ansible run one? What does the get_branches.py look like? On Wed, 14 Oct 2020 at 10:27, sk32...@gmail.com wrote: > > when I run the script with python on command line, I get the json output, > however when I run

[ansible-project] Error while Trying to run a dynamic inventory script from ldap source,

2020-10-14 Thread sk32...@gmail.com
when I run the script with python on command line, I get the json output, however when I run it with ansible-inventory or ansible-playbook I hit the following error ansible-inventory 2.9.6 config file = /Users/sm/ansible_liquibase/ansible.cfg configured module search path = ['/Users/sm/.ans