Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

When delopying OCI APEX Got from Ansible #1

Open
JC16 opened this issue Mar 3, 2020 · 6 comments
Open

When delopying OCI APEX Got from Ansible #1

JC16 opened this issue Mar 3, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@JC16
Copy link

JC16 commented Mar 3, 2020

Hi Experts,

I had create an Oracle Linux VM and installed OCI and Ansible. I was try to use the script to deployed APEX on DBCS. I had already config the localhost file given all the needed information, but when I run the ansible-playbook sample.yaml I got an error of syntax. Here is the screenshot
image

I'm not very familiar with ansible. Can someone give me a hint of how to solve this issue?

Thanks

@ken-tolwyn
Copy link
Contributor

Hi JC16,

I looks like ansible cannot find the OCI modules. see https://github.com/oracle/oci-ansible-modules for the installation guide of OCI modules.

Test if OCI was installed for the correct ansible python version
Get the ansible python version:
ansible-playbook --version
Check the pip version
pip -V
now the python version
python -V

Check if it OCI was installed, no error on the following:
python -c "import oci;"

If you get an error then OCI was not installed for the correct version:
You can do pip2 install oci or pip3 install oci (this depends on the python version of ansible).

@JC16
Copy link
Author

JC16 commented Mar 4, 2020

Hi Ken-tolwyn,

Thank you for the respond.
I had check my OCI modules setting and ansible version
The ansible-playbook version is 2.8.4 and my python version is 2.7.5
image
I can also successful import the oci from python.
But I still got the same issue of the syntax problem.
image

Do I need to upgrade my python version to python 3 ?

Thanks

@ken-tolwyn
Copy link
Contributor

Do you have a pip28 or python28 executable on your system?
if so can you run pip28 install oci ?

I looks like ansible is using the python version 2.8 while in the system OCI is installed for version 2.7.

@JC16
Copy link
Author

JC16 commented Mar 6, 2020

Hi ken-tolwyn,

I had try another work around I provision an Oracle Cloud Development VM with ansible and python install now. I'm able to run the script. The VCN and VM and been successful created, but when the script run up to run_jetty_ords script got an error of syntax error
image

What was the cause of this issue? Now I think the version of ansible and python is ok.

@ken-tolwyn ken-tolwyn added the bug Something isn't working label Mar 8, 2020
@ken-tolwyn ken-tolwyn self-assigned this Mar 8, 2020
@ken-tolwyn
Copy link
Contributor

Updated the words config task to use the full named variable database instead of db.

@ppierrondi
Copy link

Hi Ken, having the below error:
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'
ERROR! couldn't resolve module/action 'oci_internet_gateway'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/opc/oci-apex/roles/common/tasks/main.yml': line 22, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • name: Create Internet Gateway
    ^ here
    (py36env) [opc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants