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

cx_oracle: Added installation of cx_Oracle for Python3 #346

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/cx_oracle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
breaking_changes:
- "cx_oracle: Added installation of cx_Oracle for Python3 (oravirt#346)"
3 changes: 3 additions & 0 deletions changelogs/fragments/python2_deprecated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
deprecated_features:
- "modules: all modules will loose support for Python2 in ansible-oracle 4.0.0 (oravirt#346)"
26 changes: 21 additions & 5 deletions roles/cxoracle/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# cxoracle-install playbook
---
- name: Install cx_oracle
# The cx_Oracle is installed for Python2 only, when Python2 is
# used as an interpreter in Ansible.
- name: Install cx_oracle for Python2
ansible.builtin.pip:
name: "{{ cx_oracle_source | default('cx_oracle<8.0') }}"
extra_args: "{{ extra_args }}"
umask: "{{ cx_oracle_umask | default(omit) }}"
state: present
name: "{{ cx_oracle_source | default('cx_oracle<8.0') }}"
extra_args: "{{ extra_args }}"
umask: "{{ cx_oracle_umask | default(omit) }}"
state: present
when:
- install_cx_oracle
- ansible_python.version.major == 2
tags: cx_oracle

# The future ansible-oracle modules are using Python3 only
# => Install cx_Oracle for Python3 as well
- name: Install cx_oracle for Python3
ansible.builtin.pip:
name: "{{ cx_oracle3_source | default(cx_oracle_source) | default('cx_oracle') }}"
executable: pip3
extra_args: "{{ extra_args }}"
umask: "{{ cx_oracle_umask | default(omit) }}"
state: present
when: install_cx_oracle
tags: cx_oracle