|
| 1 | +# ansible-oracle-modules |
| 2 | +**Oracle modules for Ansible** |
| 3 | + |
| 4 | +- If you have any questions/requests just create an issue and I'll look into it |
| 5 | +- I've also included a playbook (test-modules.yml) that'll give you an idea on how the modules can be used. |
| 6 | + |
| 7 | +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. |
| 8 | +For more information, check out: http://docs.ansible.com/developing_modules.html |
| 9 | + |
| 10 | + |
| 11 | +Most (if not all) requires `cx_Oracle` either on your controlmachine or on the managed node. |
| 12 | + |
| 13 | +The default behaviour for the modules using `cx_Oracle` is this: |
| 14 | + |
| 15 | +- If neither username or password is passed as input to the module(s), the use of an Oracle wallet is assumed. |
| 16 | +- In that case, the `cx_Oracle.makedsn` step is skipped, and the connection will use the `'/@<service_name>'` format instead. |
| 17 | +- You then need to make sure that you're using the correct tns-entry (service_name) to match the credential stored in the wallet. |
| 18 | + |
| 19 | + |
| 20 | +These are the different modules: |
| 21 | + |
| 22 | +**oracle_user** |
| 23 | + |
| 24 | +pre-req: cx_Oracle |
| 25 | + |
| 26 | + - Creates & drops a user. |
| 27 | + - Grants privileges only (can not remove them with oracle_user, use oracle_grants for that) |
| 28 | + |
| 29 | +**oracle_tablespace** |
| 30 | + |
| 31 | +pre-req: cx_Oracle |
| 32 | + |
| 33 | + - Manages normal(permanent), temp & undo tablespaces (create, drop, make read only/read write, offline/online) |
| 34 | + - Tablespaces can be created as bigfile, autoextended |
| 35 | + |
| 36 | + |
| 37 | +**oracle_grants** |
| 38 | + |
| 39 | +pre-req: cx_Oracle |
| 40 | + |
| 41 | + - Manages privileges for a user |
| 42 | + - Grants/revokes privileges |
| 43 | + - Handles roles/sys privileges properly. Does NOT yet handle object privs. They can be added but they are not considered while revoking privileges |
| 44 | + - 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) |
| 45 | + |
| 46 | +**oracle_role** |
| 47 | + |
| 48 | +pre-req: cx_Oracle |
| 49 | + |
| 50 | + - Manages roles in the database |
| 51 | + |
| 52 | +**oracle_parameter** |
| 53 | + |
| 54 | +pre-req: cx_Oracle |
| 55 | + |
| 56 | + - Manages init parameters in the database (i.e alter system set parameter...) |
| 57 | + - 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. |
| 58 | + |
| 59 | +**Note:** |
| 60 | + When specifying sga-parameters the database requests memory based on granules which are variable in size depending on the size requested, |
| 61 | + and that means the database may round the requested value to the nearest multiple of a granule. |
| 62 | + e.g sga_max_size=1500M will be rounded up to 1504 (which is 94 granules of 16MB). That will cause the displayed value to be 1504M, which has |
| 63 | + the effect that the next time the module is is run with a desired value of 1500M it will be changed again. |
| 64 | + So that is something to consider when setting parameters that affects the SGA. |
| 65 | + |
| 66 | + **oracle_services** |
| 67 | + |
| 68 | +pre-req: cx_Oracle (if GI is not running) |
| 69 | + |
| 70 | + - Manages services in an Oracle database (RAC/Single instance) |
| 71 | + |
| 72 | +**Note:** |
| 73 | +At the moment, Idempotence only applies to the state (present,absent,started, stopped). No other options are considered. |
| 74 | + |
| 75 | + |
| 76 | +**oracle_pdb** |
| 77 | + |
| 78 | +pre-req: cx_Oracle |
| 79 | + |
| 80 | + - Manages pluggable databases in an Oracle container database |
| 81 | + - Creates/deletes/opens/closes the pdb |
| 82 | + - saves the state if you want it to. Default is yes |
| 83 | + - Can place the datafiles in a separate location |
| 84 | + |
| 85 | + |
| 86 | +**oracle_sql** |
| 87 | + |
| 88 | +pre-req: cx_Oracle |
| 89 | + |
| 90 | +- 2 modes: sql or script |
| 91 | +- Executes arbitrary sql or runs a script |
| 92 | + |
| 93 | +**Note:** |
| 94 | +Should be considered as experimental, or an alpha-release |
| 95 | + |
| 96 | + |
| 97 | +**oracle_asmdg** |
| 98 | + |
| 99 | +pre-req: cx_Oracle |
| 100 | + |
| 101 | +- Manages ASM diskgroup state. (absent/present) |
| 102 | +- Takes a list of disks and makes sure those disks are part of the DG. |
| 103 | +If the disk is removed from the disk it will be removed from the DG. |
| 104 | +- Also manages attributes |
| 105 | + |
| 106 | +**Note:** |
| 107 | +- Supports redundancy levels, but does not yet handle specifying failuregroups |
| 108 | + |
| 109 | + |
| 110 | +**oracle_asmvol** |
| 111 | + |
| 112 | +- Manages ASM volumes. (absent/present) |
| 113 | + |
| 114 | +**oracle_ldapuser** |
| 115 | + |
| 116 | +pre-req: cx_Oracle, ldap, re |
| 117 | + |
| 118 | +- Syncronises users/role grants from LDAP/Active Directory to the database |
| 119 | + |
| 120 | +**oracle_privs** |
| 121 | + |
| 122 | +pre-req: cx_Oracle, re |
| 123 | + |
| 124 | +- Manages system and object level grants |
| 125 | +- Object level grant support wildcards, so now it is possible to grant access to all tables in a schema and maintain it automatically! |
| 126 | + |
| 127 | +**oracle_jobclass** |
| 128 | + |
| 129 | +pre-req: cx_Oracle |
| 130 | + |
| 131 | +- Manages DBMS_SCHEDULER job classes |
| 132 | + |
| 133 | +**oracle_jobschedule** |
| 134 | + |
| 135 | +pre-req: cx_Oracle, re |
| 136 | + |
| 137 | +- Manages DBMS_SCHEDULER job schedules |
| 138 | + |
| 139 | +**oracle_jobwindow** |
| 140 | + |
| 141 | +pre-req: cx_Oracle, datetime |
| 142 | + |
| 143 | +- Manages DBMS_SCHEDULER windows |
| 144 | + |
| 145 | +**oracle_job** |
| 146 | + |
| 147 | +pre-req: cx_Oracle, re |
| 148 | + |
| 149 | +- Manages DBMS_SCHEDULER jobs |
| 150 | + |
| 151 | +**oracle_rsrc_consgroup** |
| 152 | + |
| 153 | +pre-req: cx_Oracle, re |
| 154 | + |
| 155 | +- Manages resource manager consumer groups including its mappings and grants |
| 156 | + |
| 157 | +**oracle_awr** |
| 158 | + |
| 159 | +pre-req: cx_Oracle, datetime |
| 160 | + |
| 161 | +- Manages AWR snapshot settings |
| 162 | + |
| 163 | +**oracle_facts** |
| 164 | + |
| 165 | +pre-req: cx_Oracle |
| 166 | + |
| 167 | +- Gathers facts about Oracle database |
| 168 | + |
| 169 | +**oracle_gi_facts** |
| 170 | + |
| 171 | +- Gathers facts about Grid Infrastructure cluster configuration |
| 172 | + |
| 173 | +**oracle_stats_prefs** |
| 174 | + |
| 175 | +pre-req: cx_Oracle |
| 176 | + |
| 177 | +- Managing DBMS_STATS global preferences |
| 178 | + |
| 179 | + |
| 180 | +**oracle_redo** |
| 181 | + |
| 182 | +pre-rec: cx_Oracle |
| 183 | + |
| 184 | +- Manage redo-groups and their size in RAC or single instance environments |
| 185 | +- NOTE: For RAC environments, the database needs to be in ARCHIVELOG mode. This is not required for SI environments. |
| 186 | + |
| 187 | +**oracle_db** |
| 188 | + |
| 189 | +pre-rec: cx_Oracle |
| 190 | + |
| 191 | +- Create/remove databases (cdb/non-cdb) |
| 192 | +- Can be created by passing in a responsefile or just by using parameters |
| 193 | + |
| 194 | + |
0 commit comments