Troubleshooting
Resolve common issues with Ansible SDK setup and usage.
Ensure your Python version is >=3.8 before you start any other troubleshooting steps.
$ python --version
Resolving common errors
Encountered: ModuleNotFoundError: No module named 'ansible_runner'
Resolution:
Check that Ansible Runner is installed in your virtual environment.
$ pip list | grep ansible_runner
Install Ansible Runner if necessary.
$ pip install ansible-runner
Encountered: ValueError: private_data_dir path is either invalid or does not exist
Resolution:
Change to the
examplesdirectory if you are running one of the Ansible SDK quickstart examples. The quickstart examples use the contents of thedatadirfolder, which maps to theprivate_data_dirpath.Ensure the
private_data_dirdirectory contains all the artifacts and metadata for your jobs. Ansible Runner requires you to put all playbooks, inventory files, and so on in theprivate_data_dirdirectory. This is the directory that you specify in your Ansible job definition with theAnsibleJobDef('datadir', 'pb.yml')object.