|
1 | 1 | # Frequently Asked Questions (FAQs) |
2 | 2 |
|
3 | | -### Common errors: |
| 3 | +## How to install the OCI Ansible Collection |
| 4 | +Please refer the [Installation Guide](https://github.com/oracle/oci-ansible-collection/blob/master/InstallationGuide.md) on different ways to install the OCI Ansible Collection. |
4 | 5 |
|
5 | | -#### WARNING: "module oracle.oci.xxx not found in path" |
6 | | -Check if the `oracle.oci` collection is installed using this command: |
7 | | -`ansible-galaxy collection list` |
8 | | -The collection is installed under the default paths: `~/.ansible/collections` or `/usr/share/ansible/collections` |
9 | | - |
10 | | ------------------------------------ |
11 | | -#### Error: "oci python sdk required for this module" |
12 | | - |
13 | | -Try first upgrading the OCI python SDK: |
14 | | -`pip install oci --upgrade` |
15 | | - |
16 | | -If the python SDK is not installed correctly, check [Ansible Install Troubleshooting Guide](ansible-oci-customer-troubleshooting/ansible-install-troubleshooting-guide.md). |
17 | | - |
18 | | ------------------------------------ |
19 | | -#### Error: "Could not find config file at ~/.oci/config" |
20 | | - |
21 | | -- Make sure you created a config file under '~/.oci/config' or you are using instance principal. |
22 | | -- To create config file, check: [Configuration_File](https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File) |
23 | | -- To use instance principal on a compute instance set the environment variable: `OCI_ANSIBLE_AUTH_TYPE=instance_principal` |
24 | | - |
25 | | ------------------------------------ |
26 | | -#### Error: "{'code': 'NotAuthenticated', 'message': 'The required information to complete authentication was not provided.', 'status': 401}" |
27 | | - |
28 | | -Check if the [Account Keys](https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#Required_Keys_and_OCIDs) |
29 | | - are generated correctly and uploaded to the user account with right permissions. |
30 | | - |
31 | | ------------------------------------ |
32 | | -#### Error: "No inventory plugins available to generate inventory, make sure you have at least one whitelisted." |
33 | | - |
34 | | -Enable the OCI Collection inventory plugin by adding it to your ansible.cfg file. For example:<br> |
35 | | -[inventory]<br> |
36 | | -enable_plugins = oracle.oci.oci<br> |
37 | | - |
38 | | -For the legacy modules, use enable_plugins = oci |
39 | | - |
40 | | ------------------------------------ |
41 | | - |
42 | | -#### In a Mac OSX controller node, Error: "ImportError: No module named yaml" when executing a playbook |
43 | | - |
44 | | -First make sure that ansible and its requirements including PyYAML are installed. |
45 | | -If you are running on macOS, and you have python installed by brew, you may see a ImportError(for example: `ImportError: No module named yaml`). |
46 | | -To resolve this, you must override the `ansible_python_interpreter` configuration option. Setting the inventory variable `ansible_python_interpreter` on any host will allow Ansible to auto-replace the interpreter used when executing python modules. |
47 | | - |
48 | | -`ansible_python_interpreter` configuration option can be set in inventory file. For example: |
49 | | - |
50 | | -```sh |
51 | | -[control-node] |
52 | | -localhost ansible_python_interpreter="/usr/local/Cellar/python/2.7.14_3/bin/python2.7" |
| 6 | +## How do I upgrade to the latest version |
| 7 | +``` |
| 8 | +ansible-galaxy collection install -f oracle.oci |
53 | 9 | ``` |
54 | 10 |
|
55 | | -OR `ansible_python_interpreter` configuration option can be set using `-e` command line option: |
| 11 | +## How to find the version of the OCI Ansible Collection installed |
| 12 | +The below command lists all the collections installed in your system and their versions. You can check the version for the entry `oracle.oci` |
| 13 | +``` |
| 14 | +ansible-galaxy collection list |
| 15 | +``` |
| 16 | +*Note: You need ansible >= 2.10 to run the above command* |
56 | 17 |
|
57 | | -```sh |
58 | | -$ ansible-playbook sample-playbook.yml -e 'ansible_python_interpreter=/usr/local/Cellar/python/2.7.14_3/bin/python2.7' |
| 18 | +## How to find the version of oci python sdk installed |
| 19 | +You can run the below command: |
| 20 | +``` |
| 21 | +python -c 'import oci; print(oci.__version__)' |
59 | 22 | ``` |
60 | 23 |
|
| 24 | +## What are the dependencies for using OCI Ansible Collection |
| 25 | +You need `ansible >= 2.9` and the latest version of `oci`. |
| 26 | + |
61 | 27 | ----------------------------------- |
62 | 28 |
|
63 | | -### Enable `debug` mode for the OCI Ansible Cloud Modules |
| 29 | +## How to enable `debug` mode |
64 | 30 |
|
65 | 31 | - Set the `log_requests` variable in your ~/.oci/config to `True` to [enable Request logging in the OCI python SDK](https://github.com/oracle/oci-python-sdk/blob/master/docs/logging.rst) |
66 | 32 | - Export an environment variable named `LOG_LEVEL` with the value `DEBUG` to enable DEBUG mode for the OCI Ansible modules |
|
0 commit comments