ansible-oracle-modules
ansible-oracle-modules copied to clipboard
oracle_services: Unlucky RAC-like calls to srvctl on Single Server
oracle_services module may return unsuccessfully with
"msg": "Error modifying service. Command: /u01/app/oracle/product/19.3.0.0/db19300_prod/bin/srvctl modify service -d XD002A -s PROFAHR_ADMIN -modifyconfig -preferred None, stdout: PRKO-2002 : Invalid command line option: -modifyconfig\nPRKO-2002 : Invalid command line option: -preferred\n, stderr: "
After a bit of a research I found that the module automatically detects a GI by stating /etc/oracle/olr.loc and then uses srvctl to manage services. If GI is not detected, it uses DBMS_SERVICE package from within the database.
The calls to srvctl use parameters that look like it's designed for RAC usage (-preferred, -available, -modifyconfig, probably more). The problem here is that those options are unavailable on a non-RAC installation (tested only with 19c, so that's an assumption I can't verify at the moment - below is my srvctl modify service -h output).
A workaround might be to force the module to use DBMS_SERVICE, but there's no interface parameter for that. Will check how I can currently continue by a quick and dirty module modification for now.
I can't suggest a real fix since I don't know how to autodetect this.
srvctl modify service -h Modifies the configuration for the service.
Usage: srvctl modify service -db <db_unique_name> -service <service_name>
[-role [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-policy {AUTOMATIC | MANUAL}]
[-notification {TRUE | FALSE}] [-clbgoal {SHORT | LONG}] [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}]
[-failovertype {NONE | SESSION | SELECT | TRANSACTION | AUTO}] [-failovermethod {NONE | BASIC}] [-failoverretry
I already mentioned this in issue #141. But it seems development on this great work has almost come to a halt.
Seems like this is caused by wrong/unfavourable initialization of 2 lists. In the end this leads to srvctl commands with "-preferred" and "-available" to be built also in non-RAC environments.
Modified oracle_services in a fork: https://github.com/mapausch/ansible-oracle-modules/blob/master/oracle_services
On my Single Instance environment this works, but don't have a RAC environment where I can test if it still works on RAC. So for now I don't want to go for a PR.