Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
# file: roles/php/tasks/oci-7.2.yml
#
# https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e
- name: Check OCI Requirement
stat:
path: /usr/lib/php/20170718/oci8.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: 0644
with_items:
- oci8
- name: Remove possible components in /tmp
file:
path: /tmp/{{ item }}
state: absent
with_items:
- instantclient_18_5
- oracle_x64_18_5_0_0_0_oci8_so_php_7
- name: Make available Oracle InstantClient
command: scp -r {{ repository }}{{ item }} /tmp/
become: no
with_items:
- instantclient_18_5
- oracle_x64_18_5_0_0_0_oci8_so_php_7
- name: Remove /opt/oracle/instantclient_18_5
file:
path: /opt/oracle/instantclient_18_5
state: absent
- name: Move Oracle InstantClient to /opt/oracle
command: mv /tmp/instantclient_18_5 /opt/oracle
- name: Move oci8 to /usr/lib/php
command: mv /tmp/oracle_x64_18_5_0_0_0_oci8_so_php_7 /usr/lib/php/20170718/oci8.so
- name: Change ownership for Oracle InstantClient
file:
path: '{{ item }}'
owner: root
group: root
recurse: yes
follow: no
with_items:
- /opt/oracle/instantclient_18_5
- name: Ensure log directories
file:
path: /opt/oracle/instantclient_18_5/log/diag/clients
owner: www-data
group: root
state: directory
mode: 0775
follow: no
- name: Set permissions in log directories
file:
path: /opt/oracle/instantclient_18_5/log
owner: www-data
group: root
mode: 0775
recurse: yes
follow: no
- name: Create symlinks
file:
src: /opt/oracle/instantclient_18_5/{{ item }}.so.18.1
dest: /opt/oracle/instantclient_18_5/{{ item }}.so
state: link
with_items:
- libclntsh
- libocci
- name: Configure libraries
template:
src: etc-ld-oracle
dest: /etc/ld.so.conf.d/oracle-instantclient.conf
owner: root
group: root
mode: 0644
- name: Update libraries
command: ldconfig
when: not oci_file.stat.exists