opitzconsulting.ansible_oracle.oracle_sql (4.7.0) — module

Execute arbitrary sql

| "added in version" 2.1.0.0 of opitzconsulting.ansible_oracle"

Authors: Mikael Sandström, oravirt@gmail.com, @oravirt

Install collection

Install with ansible-galaxy collection install opitzconsulting.ansible_oracle:==4.7.0


Add to requirements.yml

  collections:
    - name: opitzconsulting.ansible_oracle
      version: 4.7.0

Description

Execute arbitrary sql against an Oracle database


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Execute arbitrary sql
- oracle_sql:
    username: "{{ user }}"
    password: "{{ password }}"
    service_name: one.world
    sql: 'select username from dba_users'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Execute arbitrary script1
- oracle_sql:
    username: "{{ user }}"
    password: "{{ password }}"
    service_name: one.world
    script: /u01/scripts/create-all-the-procedures.sql
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Execute arbitrary script2
- oracle_sql:
    username: "{{ user }}"
    password: "{{ password }}"
    service_name: one.world
    script: /u01/scripts/create-tables-and-insert-default-values.sql

Inputs

    
sql:
    description: The sql you want to execute
    required: false

port:
    default: 1521
    description: The listener port to connect to the database
    required: false

script:
    description: The script you want to execute. Doesn't handle selects
    required: false

hostname:
    aliases:
    - host
    default: localhost
    description: The host of the database
    required: false

password:
    aliases:
    - pw
    default: None
    description: The password to connect to the database
    required: false

username:
    aliases:
    - un
    default: None
    description: The database username to connect to the database
    required: false

service_name:
    aliases:
    - sn
    default: database_name
    description: The service_name to connect to the database
    required: false