Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

892 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-oracle-modules

Oracle modules for Ansible

  • This project was forked from oravirt/ansible-oracle-modules, but also tries to consolidate fixes from other forks.
  • This fork uses different layout than original, db connection code is shared via module_utils
  • This fork prefers to use connect / as sysdba over using wallet, password or SQLNET over TCPIP
  • This fork adds modules oracle_oratab to query list od databases, oracle_tnsnames to manipulate Oracle .ora files
  • This project also contains roles to install Database, Oracle RAC, Oracle HAS on VMware, EC2, on-premise HW.
  • See project: ibre5041/ansible_oracle_modules_example as an example.

To use this collection place this in requirements.yml

---
collections:
  - name: https://github.com/ibre5041/ansible_oracle_modules.git
    type: git
    version: main

And then execute: ansible-galaxy collection install -r collections/requirements.yml

Most (if not all) modules require oracledb either on your managed node or on "control machine". To install oracledb you can use: pip3 install --user oracledb (/usr/libexec/platform-python -m pip install --user oracledb on RHEL8)

The default behaviour for the modules using oracledb is this:

  • If mode=='sysdba' connect internal / as sysdba is used
  • If neither username and password is passed as input to the module(s), the use of an Oracle wallet is assumed.
  • In that case, the oracledb.makedsn step is skipped, and the connection will use the '/@<service_name>' format instead.
  • You then need to make sure that you're using the correct tns-entry (service_name) to match the credential stored in the wallet.

Modules:

ansible-doc --type module -l ibre5041.ansible_oracle_modules
Module Description
oracle_ping Test database connection
oracle_acfs Manage ACFS filesystems
oracle_acl Manage Oracle network Access Control Lists
oracle_audit Manage Oracle Unified Auditing policies
oracle_asmdg Manage diskgroups in an Oracle database
oracle_asmvol Manage Oracle ASMCMD Volumes
oracle_awr Manage AWR configuration
oracle_dataguard Manage Oracle Data Guard configurations
oracle_datapatch Manage datapatch functionality
oracle_db Create/delete a database using dbca
oracle_dblink Manage Oracle database links
oracle_crs_asm Manage CRS/HAS resource ASM instance
oracle_crs_db Manage CRS/HAS resource database
oracle_crs_listener Manage CRS/HAS resource listener
oracle_crs_service Manage CRS/HAS resource database service
oracle_directory Create/drop DIRECTORY in an Oracle database
oracle_facts Returns some facts about Oracle DB
oracle_flashback Manage Oracle restore points and flashback database
oracle_gi_facts Returns some facts about Grid Infrastructure environment
oracle_grant Manage grant/privileges in an Oracle database
oracle_jobclass
oracle_job
oracle_jobschedule
oracle_jobwindow
oracle_ldapuser
oracle_opatch Manage patches in an Oracle environment
oracle_oratab Reads oratab to ansible_facts, get list of databases on server
oracle_orapki Manage Oracle PKI wallets, certificates, and credentials via orapki
oracle_parameter Manage parameters in an Oracle database
oracle_pdb Manage pluggable databases in Oracle
oracle_privs
oracle_profile Manage profiles in an Oracle database
oracle_redo Manage Oracle redo related things
oracle_role Manage users/roles in an Oracle database
oracle_rsrc_consgroup Manage DBMS_RESOURCE_MANAGER consumer groups
oracle_rsrc_plan
oracle_services Manage services in an Oracle database
oracle_sqldba Execute sql (scripts) using sqlplus (BEQ) or catcon.pl
oracle_sql Execute arbitrary sql
oracle_stats_prefs Manage DBMS_STAT
oracle_tablespace Manage tablespaces in an Oracle database
oracle_tde Manage Oracle Transparent Data Encryption (TDE)
oracle_tnsnames Manipulate Oracle's tnsnames.ora and other .ora files
oracle_user Manage users/schemas in an Oracle database
oracle_wallet Manage Oracle TDE keystores (wallets)

Filters

ansible-doc --type filter -l ibre5041.ansible_oracle_modules
Filter Description
pwhash12c Compute hash of Oracle password

NOTE: This filter also depends on: pip install pbkdf2

Roles

ansible-doc --type role -l ibre5041.ansible_oracle_modules
Role Description
default_vars_only Role containing configuration space, variables used by other roles
base_oracle_ec2 Basic OS configuration for Oracle on EC2
base_oracle_vbox Basic OS configuration for Oracle on VirtualBox
base_oracle_vmware Basic OS configuration for Oracle on VMware ESX
oracle_asm_disks_ec2 Configure ASM store, install udev rules for EC2
oracle_asm_disks_vbox Configure ASM store, install udev rules for VirtualBox
oracle_asm_disks_vmware Configure ASM store, install udev rules for VMware ESX
oracle_crs_os_setup RAC specific OS tasks, ssh-equiv, shared disk partitions
oracle_crs_19c Install Oracle RAC
oracle_restart_19c Install Oracle HAS
oracle_db_home Install Oracle RDBMS binaries
oracle_download_package Downloaded and unpack Oracle (golden) image .zip file
oracle_post_install Post installation task, Oracle .bash_profile and other utility scripts
oracle_systemd Systemd startup unit file and scripts

Virtual Hardware

  • VMware, VirtualBox and EC2 are suppored

  • Oracle RAC is suppported only in VMware and VirtualBox

  • VMware

  • VirtualBox

  • EC2

Development

  • Upload source code repo into database server into ~oracle/

  • yum install ansible

  • mkdir -p devroot/ansible_collections/ibre5041/ansible_oracle_modules/plugins

  • ln -s "$PWD/ansible_oracle_modules/plugins/module_utils" ~/devroot/ansible_collections/ibre5041/ansible_oracle_modules/plugins/module_utils

  • export PYTHONPATH="$PWD/devroot:$PYTHONPATH"

  • python3 -c "import ansible_collections.ibre5041.ansible_oracle_modules.plugins.module_utils.oracle_homes"

  • prepare module paremeter .json file, like: module_args.db.json

  • check it: cat module_args.db.json | jq .

  • execute and develop module:

    python ./ansible_oracle_modules/plugins/modules/oracle_db.py module_args.db.json

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages