Skip to content

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

@mapausch

Description

@mapausch

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

mapausch commented on Mar 5, 2024

@mapausch
Author

referring to #113 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mapausch

        Issue actions

          module oracle_services.py: "Error modifying service" in Single Instance environment · Issue #174 · opitzconsulting/ansible-oracle