oravirt / ansible-oracle-modules

Oracle modules for Ansible
MIT License
214 stars 159 forks source link

Cannot create a tablespace without giving a size #107

Open tyskjohan opened 5 years ago

tyskjohan commented 5 years ago

"Blergh, something went wrong while executing - ORA-02237: invalid file size sql: create bigfile tablespace users datafile size None"

{
"_ansible_item_label": "ora_meta_ocitest0",
"_ansible_item_result": true,
"_ansible_no_log": false,
"_ansible_parsed": true,
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"autoextend": false,
"bigfile": true,
"content": "permanent",
"datafile": null,
"hostname": "elhdb1-ocitest0-scan.ocitest0.elhubdevvcn.oraclevcn.com",
"maxsize": null,
"mode": "sysdba",
"nextsize": null,
"numfiles": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": "1521",
"service_name": "ora_meta_ocitest0.ocitest0.elhubdevvcn.oraclevcn.com",
"size": null,
"state": "present",
"tablespace": "users",
"user": "sys"
}
},
"item": "ora_meta_ocitest0",
"msg": "Blergh, something went wrong while executing - ORA-02237: invalid file size sql: create bigfile tablespace users datafile size None"
},

The size_clause is not mandatory in tablespace creation, and the API should support referring to the default.

oravirt commented 5 years ago

I'll fix it

oravirt commented 5 years ago

Fixed now. It'll error if size is not defined

tyskjohan commented 5 years ago

But why should the Ansible module force a parameter that the database doesn't require?

oravirt commented 5 years ago

No it's not required, but it's a behaviour (in Oracle) that is just horrible. You're going through the trouble to apply state to a resource so why not do that in a way so you know what you get?

That being said, it's probably a pretty easy fix to mimic this behaviour but I'm reluctant to do so....