Skip to content
Snippets Groups Projects
Commit 813d4044 authored by jurgenhaas's avatar jurgenhaas
Browse files

Rework OCI installation for various PHP versions

parent 775fe884
No related branches found
No related tags found
No related merge requests found
---
# file: roles/php/tasks/oci-5.3.yml
#
# @see OCI8 Install: https://help.ubuntu.com/community/PHPOracle
# Better:
# @see PDO_OCI Install: https://drupal.org/comment/5572626#comment-5572626
- name: "PHP | Check OCI Requirement"
stat:
path: '/usr/lib/php5/20090626/pdo_oci.so'
register: oci_file
- block:
- name: "PHP | OCI | Enable OCI for PHP"
copy:
content: 'extension={{ item }}.so'
dest: '/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini'
owner: 'root'
group: 'root'
mode: '644'
with_items:
- 'oci8'
- 'pdo_oci'
- name: "PHP | OCI | Remove possible components in /tmp"
file:
path: '/tmp/{{ item }}'
state: 'absent'
with_items:
- 'instantclient_11_2'
- 'oracle_x64_11_2_0_3_0_oci8_so'
- 'oracle_x64_11_2_0_3_0_pdo_oci_so'
- name: "PHP | OCI | Make available Oracle InstantClient"
command: scp -r {{ repository }}{{ item }} /tmp/
become: no
with_items:
- 'instantclient_11_2'
- 'oracle_x64_11_2_0_3_0_oci8_so'
- 'oracle_x64_11_2_0_3_0_pdo_oci_so'
- name: "PHP | OCI | Remove /usr/local/lib/instantclient_11_2"
file:
path: '/usr/local/lib/instantclient_11_2'
state: 'absent'
- name: "PHP | OCI | Move Oracle InstantClient to /usr/local/lib"
command: mv /tmp/instantclient_11_2 /usr/local/lib/
- name: "PHP | OCI | Move oci8 to /usr/lib/php5"
command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so /usr/lib/php5/20090626/oci8.so
- name: "PHP | OCI | Move pdo_oci to /usr/lib/php5"
command: mv /tmp/oracle_x64_11_2_0_3_0_pdo_oci_so /usr/lib/php5/20090626/pdo_oci.so
- name: "PHP | OCI | Change ownership for Oracle InstantClient"
file:
path: '{{ item }}'
owner: 'root'
group: 'root'
recurse: yes
with_items:
- '/usr/local/lib/instantclient_11_2'
- '/usr/lib/php5/20090626/oci8.so'
- '/usr/lib/php5/20090626/pdo_oci.so'
- name: "PHP | OCI | Make available libclntsh.so"
file:
src: '/usr/local/lib/instantclient_11_2/libclntsh.so.11.1'
dest: '/usr/local/lib/instantclient_11_2/libclntsh.so'
state: 'link'
when: not oci_file.stat.exists
---
# file: roles/php/tasks/oci-5.5.yml
- debug: msg="OCI8 for PHP 5.5 not implemented ywt"
---
# file: roles/php/tasks/oci-7.yml
- name: "Check OCI Requirement"
stat:
path: '/usr/lib/php/20151012/oci.so'
register: oci_file
- block:
- name: "Enable OCI for PHP"
copy:
content: 'extension={{ item }}.so'
dest: '/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini'
owner: 'root'
group: 'root'
mode: '644'
with_items:
- 'oci8'
- name: "Remove possible components in /tmp"
file:
path: '/tmp/{{ item }}'
state: 'absent'
with_items:
- 'instantclient_11_2'
- 'oracle_x64_11_2_0_3_0_oci8_so_php_7'
- name: "Make available Oracle InstantClient"
command: scp -r {{ repository }}{{ item }} /tmp/
become: no
with_items:
- 'instantclient_11_2'
- 'oracle_x64_11_2_0_3_0_oci8_so_php_7'
- name: "Remove /usr/local/lib/instantclient_11_2"
file:
path: '/usr/local/lib/instantclient_11_2'
state: 'absent'
- name: "Move Oracle InstantClient to /usr/local/lib"
command: mv /tmp/instantclient_11_2 /usr/local/lib/
- name: "Move oci8 to /usr/lib/php"
command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so_php_7 /usr/lib/php/20151012/oci8.so
- name: "Change ownership for Oracle InstantClient"
file:
path: '{{ item }}'
owner: 'root'
group: 'root'
recurse: yes
with_items:
- '/usr/local/lib/instantclient_11_2'
- '/usr/lib/php/20151012/oci8.so'
- name: "Make available libclntsh.so"
file:
src: '/usr/local/lib/instantclient_11_2/libclntsh.so.11.1'
dest: '/usr/local/lib/instantclient_11_2/libclntsh.so'
state: 'link'
when: not oci_file.stat.exists
---
# file: roles/php/tasks/oci.yml
#
# @see OCI8 Install: https://help.ubuntu.com/community/PHPOracle
# Better:
# @see PDO_OCI Install: https://drupal.org/comment/5572626#comment-5572626
- name: "PHP | OCI | Enable OCI for PHP"
copy:
content='extension={{ item }}.so'
dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini
owner=root
group=root
mode='644'
with_items:
- oci8
- pdo_oci
- name: "PHP | OCI | Remove possible components in /tmp"
command: rm -Rf /tmp/{{ item }}
with_items:
- instantclient_11_2
- oracle_x64_11_2_0_3_0_oci8_so
- oracle_x64_11_2_0_3_0_pdo_oci_so
- name: "PHP | OCI | Make available Oracle InstantClient"
command: scp -r {{ repository }}{{ item }} /tmp/
become: no
with_items:
- instantclient_11_2
- oracle_x64_11_2_0_3_0_oci8_so
- oracle_x64_11_2_0_3_0_pdo_oci_so
- name: "PHP | OCI | Remove /usr/local/lib/instantclient_11_2"
command: rm -Rf /usr/local/lib/instantclient_11_2
- name: "PHP | OCI | Move Oracle InstantClient to /usr/local/lib"
command: mv /tmp/instantclient_11_2 /usr/local/lib/
- name: "PHP | OCI | Move oci8 to /usr/lib/php5"
command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so /usr/lib/php5/20090626/oci8.so
- name: "PHP | OCI | Move pdo_oci to /usr/lib/php5"
command: mv /tmp/oracle_x64_11_2_0_3_0_pdo_oci_so /usr/lib/php5/20090626/pdo_oci.so
- name: "PHP | OCI | Change ownership for Oracle InstantClient"
file:
path="{{ item }}"
owner="root"
group="root"
recurse=yes
with_items:
- /usr/local/lib/instantclient_11_2
- /usr/lib/php5/20090626/oci8.so
- /usr/lib/php5/20090626/pdo_oci.so
- name: "PHP | OCI | Make available libclntsh.so"
file:
src=/usr/local/lib/instantclient_11_2/libclntsh.so.11.1
dest=/usr/local/lib/instantclient_11_2/libclntsh.so
state=link
......@@ -114,17 +114,8 @@
owner=www-data
group=www-data
- name: "PHP | Check OCI Requirement"
shell: ls /usr/lib/php5/20090626/pdo_oci.so
register: oci_available
when: php_needs_oci8
ignore_errors: yes
changed_when: oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'
notify:
- "Apache | Restart Apache"
- include: oci.yml
when: repository is defined and php_needs_oci8 and oci_available.stdout != '/usr/lib/php5/20090626/pdo_oci.so'
- include: oci-{{ php_version|default('5.5') }}.yml
when: repository is defined and php_needs_oci8
- name: "PHP | Ensure ImageMagick config directory"
file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment