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

eks_nodegroup module remote_access config not working as documented #1771

Closed
1 task done
romulus-ai opened this issue Apr 13, 2023 · 0 comments · Fixed by #1781
Closed
1 task done

eks_nodegroup module remote_access config not working as documented #1771

romulus-ai opened this issue Apr 13, 2023 · 0 comments · Fixed by #1781

Comments

@romulus-ai
Copy link
Contributor

Summary

When I try to create a nodegroup with remote_access config as documented, I got following error:

Couldn't create Nodegroup devcluster-eu-central-1a.: Parameter validation failed: Unknown parameter in remoteAccess: "ec2_ssh_key", must be one of: ec2SshKey, sourceSecurityGroups Unknown parameter in remoteAccess: "source_sg", must be one of: ec2SshKey, sourceSecurityGroups

However when I use the suggested camelcase, I get an validation error:

msg: 'Unsupported parameters for (community.aws.eks_nodegroup) module: remote_access.ec2SshKey, remote_access.sourceSecurityGroups. Supported parameters include: ec2_ssh_key, source_sg.'

Think there needs to be a translation from unterscore ansible definition to camelcase from boto in this line, similar to "update_config":
https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/eks_nodegroup.py#L518

I will try to debug further and may provide a PR if successful.

Issue Type

Bug Report

Component Name

eks_nodegroup

Ansible Version

$ ansible --version

ansible [core 2.14.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Collection Versions

$ ansible-galaxy collection list

community.aws                 5.2.0  

AWS SDK versions

$ pip show boto boto3 botocore
Name: boto3
Version: 1.26.95
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
---
Name: botocore
Version: 1.29.95
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: boto3, s3transfer

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

Steps to Reproduce

Using the module quiet normal

- name: Create nodegroup for internal usage
  community.aws.eks_nodegroup:
    name: "{{ eks_cluster_name }}-{{ item.subnet.availability_zone }}"
    cluster_name: "{{ eks_cluster_name }}"
    node_role: "{{ iam_role_eks_nodegroup.arn }}"
    subnets:
      - "{{ item.subnet.id }}"
    scaling_config: "{{ eks_nodegroup.scaling_config }}"
    update_config:
      max_unavailable: 1
    disk_size: "{{ eks_nodegroup.disk_size }}"
    instance_types: "{{ eks_nodegroup.instance_types }}"
    ami_type: "{{ eks_nodegroup.ami_type }}"
    labels:
      env: "internal"
    capacity_type: "{{ eks_nodegroup.capacity_type }}"
    remote_access:
      ec2_ssh_key: "{{ k8s_admin_keypair.key.id }}"
      source_sg:
        - "{{ k8s_ssh_securitygroup.group_id }}"
    wait: true

Expected Results

No error from boto or the module itself and injected ssh key on all workers

Actual Results

Couldn't create Nodegroup devcluster-eu-central-1a.: Parameter validation failed:
    Unknown parameter in remoteAccess: "ec2_ssh_key", must be one of: ec2SshKey, sourceSecurityGroups
    Unknown parameter in remoteAccess: "source_sg", must be one of: ec2SshKey, sourceSecurityGroups

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 19, 2023
…1773)

eks_nodegroup - fixing remote access and added to integration tests

SUMMARY
Fixes #1771
Handling remote_access configuration the right way that boto understands it. Also included it to integration tests.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
eks_nodegroup

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Thomas Bruckmann
Reviewed-by: Mark Chappell
tremble pushed a commit to tremble/community.aws that referenced this issue Apr 20, 2023
…nsible-collections#1773)

eks_nodegroup - fixing remote access and added to integration tests

SUMMARY
Fixes ansible-collections#1771
Handling remote_access configuration the right way that boto understands it. Also included it to integration tests.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
eks_nodegroup

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Thomas Bruckmann
Reviewed-by: Mark Chappell
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 20, 2023
…1773) (#1781)

eks_nodegroup - fixing remote access and added to integration tests

SUMMARY
This was incorrectly merged directly into stable-5 rather than main.
Fixes #1771
Handling remote_access configuration the right way that boto understands it. Also included it to integration tests.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
eks_nodegroup
ADDITIONAL INFORMATION
This is pulling #1773 from stable-5 into main
Reviewed-by: Markus Bergholz
Reviewed-by: Thomas Bruckmann
Reviewed-by: Mark Chappell

Reviewed-by: Markus Bergholz <[email protected]>
abikouo pushed a commit to abikouo/community.aws that referenced this issue Oct 24, 2023
* Add tox labels for lint, format and unit tests

* [7.0.0] Apply isort to imports

* Add isort to tox

* Update workflow to run isort tests

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant