-
Notifications
You must be signed in to change notification settings - Fork 5
Description
in ensure_service_state() the lists _wanted_ai and _wanted_pi get initialized with one element of empty string
_wanted_ai = ['']
_wanted_pi = ['']
In non-RAC environments (where "preferred instances" and "available instances" are not possible) the function _get_service_config() returns empty lists _curr_config_inst_ai[] and _curr_config_inst_pi[] .
Due to this, the comparisons are always "false" in non-RAC:
if _wanted_pi != _curr_config_pi:
_inst_temp += ' -preferred %s' % (preferred_instances)
if _wanted_ai != _curr_config_ai and '' not in _wanted_ai:
_inst_temp += ' -available %s' % (available_instances)
So ensure_service_config() builds commands like "srvctl modify service -d MyDB1 -s MYDBSERVICE -modifyconfig -preferred None",
which is invalid in non-RAC environments and leads to
fatal: [mydbmachine]: FAILED! => {"changed": false, "msg": "Error modifying service. Command: /u01/app/oracle/product/19/db_1/bin/srvctl modify service -d MyDB1 -s MYDBSERVICE -modifyconfig -preferred None, stdout: PRKO-2002 : Invalid command line option: -modifyconfig\nPRKO-2002 : Invalid command line option: -preferred\n, stderr:
I modified the python code in https://github.com/mapausch/opitz-ansible-oracle/blob/master/plugins/modules/oracle_services.py
In my Single Instance environment this works, but don't have a RAC environment for testing :-(
Activity
mapausch commentedon Mar 5, 2024
referring to #113 :-)