ibre5041.ansible_oracle_modules.oracle_tnsnames (3.2.0) — module

Manipulate Oracles tnsnames.ora and other .ora files

| "added in version" 3.0.1 of ibre5041.ansible_oracle_modules"

Authors: Ivan Brezina

Install collection

Install with ansible-galaxy collection install ibre5041.ansible_oracle_modules:==3.2.0


Add to requirements.yml

  collections:
    - name: ibre5041.ansible_oracle_modules
      version: 3.2.0

Description

Manipulate Oracles tnsnames.ora and other .ora files

Must be run on a remote host

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Remove DESCRIPTION/ENABLE from RMAN alias
  oracle_tnsnames:
    path: "{{ tnsnames_file }}"
    alias: "RMAN"
    state: absent
    attribute_path: "DESCRIPTION/ENABLE"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Add DESCRIPTION/ENABLE=ENABLE to RMAN alias"
  oracle_tnsnames:
    path: "{{ tnsnames_file }}"
    alias: "RMAN"
    state: present
    attribute_path: "DESCRIPTION/ENABLE"
    attribute_value: "BROKEN"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Change value or SQLNET.EXPIRE_TIME"
  oracle_tnsnames:
    path: "{{ tnsnames_file }}"
    alias: "SQLNET.EXPIRE_TIME"
    state: present
    whole_value: 20
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Parse listener.ora.in return SID_LIST_ASM_LISTENER"
  oracle_tnsnames:
    path: "{{ listener_file }}"
    alias: "SID_LIST_ASM_LISTENER"
  register: _listerner
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug: var=_listerner.msg
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set new ORACLE_HOME in listener.ora.in for SID_LIST_ASM_LISTENER
  oracle_tnsnames:
    path: "{{ listener_file }}"
    alias: "SID_LIST_ASM_LISTENER"
    attribute_path: "SID_LIST/SID_DESC/ORACLE_HOME"
    attribute_value: "/oracle/grid/product/19.3.0.0"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove ENVS from listener.ora.in for SID_LIST_LISTENER
  oracle_tnsnames:
    path: "{{ listener_file }}"
    alias: "SID_LIST_LISTENER"
    attribute_name: "ENVS"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove whole alias DYNAMIC_REGISTRATION_LISTENER=OFF from listener.ora
  oracle_tnsnames:
    path: "{{ listener_file }}"
    alias: "DYNAMIC_REGISTRATION_LISTENER"
    state: absent

Inputs

    
path:
    description:
    - location of .ora file
    required: true

alias:
    description: name of stanza alias in .ora file.
    required: true

backup:
    default: false
    description:
    - Create a backup file including the timestamp information so you can get the original
      file back if you somehow clobbered it incorrectly.
    required: false
    type: bool

follow:
    default: true
    description: Follow symlinks
    required: false

whole_value:
    description: The whole string value for a specified alias
    required: false

attribute_name:
    description:
    - name of attribute to be affected at any depth
    - for example ORACLE_HOME or ORACLE_SID
    required: false

attribute_path:
    description:
    - xpath like expression in .ora stanza
    - 'for example: SID_LIST/SID_DESC/ORACLE_HOME'
    required: false

attribute_value:
    description: value to be stored eiter by attribute_path or attribute_name
    required: false