Need help with ansible-oracle-modules?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

169 Stars 127 Forks MIT License 288 Commits 67 Opened issues


Oracle modules for Ansible

Services available


Need anything else?

Contributors list


Oracle modules for Ansible

  • If you have any questions/requests just create an issue and I'll look into it
  • I've also included a playbook (test-modules.yml) that'll give you an idea on how the modules can be used.

To use the modules, create a 'library' directory next to your top level playbooks and put the different modules in that directory. Then just reference them as you would any other module. For more information, check out:

Most (if not all) requires

either on your controlmachine or on the managed node.

The default behaviour for the modules using

is this:
  • If neither username or password is passed as input to the module(s), the use of an Oracle wallet is assumed.
  • In that case, the
    step is skipped, and the connection will use the
    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.

These are the different modules:


pre-req: cx_Oracle

  • Creates & drops a user.
  • Grants privileges only (can not remove them with oracleuser, use oraclegrants for that)


pre-req: cx_Oracle

  • Manages normal(permanent), temp & undo tablespaces (create, drop, make read only/read write, offline/online)
  • Tablespaces can be created as bigfile, autoextended


pre-req: cx_Oracle

  • Manages privileges for a user
  • Grants/revokes privileges
  • Handles roles/sys privileges properly. Does NOT yet handle object privs. They can be added but they are not considered while revoking privileges
  • The grants can be added as a string (dba,'select any dictionary','create any table'), or in a list (ie.g for use with with_items)


pre-req: cx_Oracle

  • Manages roles in the database


pre-req: cx_Oracle

  • Manages init parameters in the database (i.e alter system set parameter...)
  • Also handles underscore parameters. That will require using mode=sysdba, to be able to read the X$ tables needed to verify the existence of the parameter.

Note: When specifying sga-parameters the database requests memory based on granules which are variable in size depending on the size requested, and that means the database may round the requested value to the nearest multiple of a granule. e.g sgamaxsize=1500M will be rounded up to 1504 (which is 94 granules of 16MB). That will cause the displayed value to be 1504M, which has the effect that the next time the module is is run with a desired value of 1500M it will be changed again. So that is something to consider when setting parameters that affects the SGA.


pre-req: cx_Oracle (if GI is not running)

  • Manages services in an Oracle database (RAC/Single instance)

Note: At the moment, Idempotence only applies to the state (present,absent,started, stopped). No other options are considered.


pre-req: cx_Oracle

  • Manages pluggable databases in an Oracle container database
  • Creates/deletes/opens/closes the pdb
  • saves the state if you want it to. Default is yes
  • Can place the datafiles in a separate location


pre-req: cx_Oracle

  • 2 modes: sql or script
  • Executes arbitrary sql or runs a script

Note: Should be considered as experimental, or an alpha-release


pre-req: cx_Oracle

  • Manages ASM diskgroup state. (absent/present)
  • Takes a list of disks and makes sure those disks are part of the DG. If the disk is removed from the disk it will be removed from the DG.
  • Also manages attributes

Note: - Supports redundancy levels, but does not yet handle specifying failuregroups


  • Manages ASM volumes. (absent/present)


pre-req: cx_Oracle, ldap, re

  • Syncronises users/role grants from LDAP/Active Directory to the database


pre-req: cx_Oracle, re

  • Manages system and object level grants
  • Object level grant support wildcards, so now it is possible to grant access to all tables in a schema and maintain it automatically!


pre-req: cx_Oracle

  • Manages DBMS_SCHEDULER job classes


pre-req: cx_Oracle, re

  • Manages DBMS_SCHEDULER job schedules


pre-req: cx_Oracle, datetime

  • Manages DBMS_SCHEDULER windows


pre-req: cx_Oracle, re

  • Manages DBMS_SCHEDULER jobs


pre-req: cx_Oracle, re

  • Manages resource manager consumer groups including its mappings and grants


pre-req: cx_Oracle, datetime

  • Manages AWR snapshot settings


pre-req: cx_Oracle

  • Gathers facts about Oracle database


  • Gathers facts about Grid Infrastructure cluster configuration


pre-req: cx_Oracle

  • Managing DBMS_STATS global preferences


pre-rec: cx_Oracle

  • Manage redo-groups and their size in RAC or single instance environments
  • NOTE: For RAC environments, the database needs to be in ARCHIVELOG mode. This is not required for SI environments.


pre-rec: cx_Oracle

  • Create/remove databases (cdb/non-cdb)
  • Can be created by passing in a responsefile or just by using parameters

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.