Newer
Older
---
# file: roles/php/tasks/oci-7.yml
- name: "Check OCI Requirement"
stat:
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
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'
- name: "Ensure log directories"
file:
path: '/usr/local/lib/instantclient_11_2/log/diag/clients'
owner: 'www-data'
group: 'root'
state: 'directory'
mode: '775'
follow: no
- name: "Set permissions in log directories"
file:
path: '/usr/local/lib/instantclient_11_2/log'
owner: 'www-data'
group: 'root'
mode: '775'
recurse: yes
follow: no
- 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