Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module oracle_services.py: "Error modifying service" in Single Instance environment #174

Closed
mapausch opened this issue Mar 4, 2024 · 1 comment

Comments

@mapausch
Copy link

mapausch commented Mar 4, 2024

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 :-(

@mapausch
Copy link
Author

mapausch commented Mar 5, 2024

referring to #113 :-)

@mapausch mapausch closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant