113 lines
2.6 KiB
YAML
113 lines
2.6 KiB
YAML
---
|
|
# tasks file restconfig
|
|
- name: Create directory for network files
|
|
file:
|
|
path: /opt/oracle/network
|
|
state: directory
|
|
owner: oracle
|
|
group: dba
|
|
mode: '0755'
|
|
|
|
############################
|
|
# copy Basis tnsnames.ora und sqlnet.ora
|
|
###########################
|
|
- name: copy tnsnames.ora
|
|
copy:
|
|
src: roles/restconfig/templates/tnsnames.ora
|
|
dest: "/opt/oracle/network"
|
|
owner: oracle
|
|
group: dba
|
|
|
|
- name: copy sqlnet.ora
|
|
copy:
|
|
src: roles/restconfig/templates/sqlnet.ora
|
|
dest: "/opt/oracle/network"
|
|
owner: oracle
|
|
group: dba
|
|
|
|
###################################
|
|
# Vorhandene ORACLE_HOMEs einlesen
|
|
###################################
|
|
|
|
- name: Find oracle_homes
|
|
find:
|
|
paths: /opt/oracle/db
|
|
file_type: directory
|
|
recurse: no
|
|
register: files_matched
|
|
|
|
|
|
############################
|
|
# Verlinkung der tnsnnames etc. nach /opt/oracle/network
|
|
###########################
|
|
- name: linking tnsnames.ora
|
|
file:
|
|
src: /opt/oracle/network/tnsnames.ora
|
|
dest: "{{ item.path }}/network/admin/tnsnames.ora"
|
|
force: yes
|
|
owner: oracle
|
|
group: dba
|
|
follow: no
|
|
state: link
|
|
loop: "{{ files_matched.files|flatten(levels=1) }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
|
|
- name: linking sqlnet.ora
|
|
file:
|
|
src: /opt/oracle/network/sqlnet.ora
|
|
dest: "{{ item.path }}/network/admin/sqlnet.ora"
|
|
force: yes
|
|
owner: oracle
|
|
group: dba
|
|
follow: no
|
|
state: link
|
|
loop: "{{ files_matched.files|flatten(levels=1) }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
|
|
- name: linking listener.ora
|
|
file:
|
|
src: /opt/oracle/network/listener.ora
|
|
dest: "{{ item.path }}/network/admin/listener.ora"
|
|
force: yes
|
|
owner: oracle
|
|
group: dba
|
|
follow: no
|
|
state: link
|
|
loop: "{{ files_matched.files|flatten(levels=1) }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
|
|
############################
|
|
# softlinks für Networker anlegen
|
|
###########################
|
|
|
|
- name: Softlink libobk.so im lib der ORACLE_HOMEs anlegen
|
|
file:
|
|
src: /usr/lib/libnsrora.so
|
|
dest: "{{ item.path }}/lib/libobk.so"
|
|
force: yes
|
|
owner: oracle
|
|
group: dba
|
|
follow: no
|
|
state: link
|
|
loop: "{{ files_matched.files|flatten(levels=1) }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
|
|
##############################
|
|
# linking emagent with latest oracle_home
|
|
##############################
|
|
|
|
- name: Find out latest oracle_home
|
|
find:
|
|
paths: /opt/oracle/db
|
|
file_type: directory
|
|
recurse: no
|
|
register: files
|
|
|
|
- debug: msg="{{ files.files[1] | sort(attribute='path', reverse=True) | map(attribute='path') | join(',') }}"
|
|
|
|
- debug: msg="{{ files }}"
|