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

opensearch Module Fails to Update Existing Domains #2161

Open
1 task done
ichekaldin opened this issue Sep 30, 2024 · 0 comments · May be fixed by #2162
Open
1 task done

opensearch Module Fails to Update Existing Domains #2161

ichekaldin opened this issue Sep 30, 2024 · 0 comments · May be fixed by #2162

Comments

@ichekaldin
Copy link
Contributor

Summary

opensearch module fails to update existing domains with the following error:

Couldn't update domain example-name: Parameter validation failed:\nUnknown parameter in AIMLOptions.NaturalLanguageQueryGenerationOptions: \"CurrentState\", must be one of: DesiredState

I believe this happens because describe_domain_config method returns the following values under AIMLOptions.Options.NaturalLanguageQueryGenerationOptions:

          'AIMLOptions': {
            'Options': {
                'NaturalLanguageQueryGenerationOptions': {
                    'DesiredState': 'ENABLED'|'DISABLED',
                    'CurrentState': 'NOT_ENABLED'|'ENABLE_COMPLETE'|'ENABLE_IN_PROGRESS'|'ENABLE_FAILED'|'DISABLE_COMPLETE'|'DISABLE_IN_PROGRESS'|'DISABLE_FAILED'
                }
            },
...

whereas update_domain_config method expects only DesiredState:

    AIMLOptions={
        'NaturalLanguageQueryGenerationOptions': {
            'DesiredState': 'ENABLED'|'DISABLED'
        }
    }

I believe this can be fixed by removing CurrentState in get_domain_config method in plugins/module_utils/opensearch.py

Issue Type

Bug Report

Component Name

opensearch

Ansible Version

$ ansible --version
ansible [core 2.17.4]
  config file = /Users/placeholder/.ansible.cfg
  configured module search path = [''/usr/share/ansible/plugins/modules']
  ansible collection location = /Users/placeholder/.ansible/collections:
  python version = 3.12.6 (main, Sep  6 2024, 19:03:47) [Clang 15.0.0 (clang-1500.3.9.4)]
  jinja version = 3.1.4
  libyaml = True

Collection Versions

$ ansible-galaxy collection list
Collection            Version
--------------------- -------
amazon.aws            8.2.1  
ansible.netcommon     7.1.0  
ansible.posix         1.6.0  
ansible.utils         5.1.1  
community.aws         8.0.0  
community.general     9.4.0  

AWS SDK versions

$ pip show boto boto3 botocore
Name: boto3
Version: 1.35.29
---
Name: botocore
Version: 1.35.29

Configuration

No response

OS / Environment

No response

Steps to Reproduce

- community.aws.opensearch:
    domain_name: example
    access_policies: "{{ access_policy }}"
    cluster_config:
      availability_zone_count: 3
      dedicated_master: false
      instance_count: 3
      instance_type: t3.medium.search
      zone_awareness: true
    domain_endpoint_options:
      enforce_https: true
      tls_security_policy: Policy-Min-TLS-1-2-2019-07'
    ebs_options:
      ebs_enabled: true
      volume_size: 25
      volume_type: gp3
    engine_version: OpenSearch_1.3
    vpc_options:
      security_groups:
        - sg-1234abcd
      subnets:
        - subnet-1234abcd
        - subnet-1234abce
        - subnet-1234abcf
    wait: true
    wait_timeout: 1500
    state: present

Expected Results

Opensearch domain is updated.

Actual Results

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Unknown parameter in AIMLOptions.NaturalLanguageQueryGenerationOptions: "CurrentState", must be one of: DesiredState
fatal: [localhost]: FAILED! => {"boto3_version": "1.35.29", "botocore_version": "1.35.29", "changed": false, "msg": "Couldn't update domain example-name: Parameter validation failed:\nUnknown parameter in AIMLOptions.NaturalLanguageQueryGenerationOptions: \"CurrentState\", must be one of: DesiredState"}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ichekaldin ichekaldin linked a pull request Sep 30, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant