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

Support SubnetMappings in actual AWS create LB call #42060

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

blamarvt
Copy link
Contributor

@blamarvt blamarvt commented Jun 28, 2018

SUMMARY

When using the elb_network_lb resource I was attempting to set the subnet_mappings attribute as documented but received this error when running the playbook:

An error occurred (ValidationError) when calling the CreateLoadBalancer operation: At least one subnet must be specified

Here is the full output, showing that subnet_mappings was indeed set:

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_Y9yjVK/ansible_modlib.zip/ansible/module_utils/aws/elbv2.py", line 370, in create_elb
    self.elb = AWSRetry.jittered_backoff()(self.connection.create_load_balancer)(**params)['LoadBalancers'][0]
  File "/tmp/ansible_Y9yjVK/ansible_modlib.zip/ansible/module_utils/cloud.py", line 150, in retry_func
    raise e
ClientError: An error occurred (ValidationError) when calling the CreateLoadBalancer operation: At least one subnet must be specified

fatal: [localhost]: FAILED! => {
    "boto3_version": "1.7.46", 
    "botocore_version": "1.10.46", 
    "changed": false, 
    "error": {
        "code": "ValidationError", 
        "message": "At least one subnet must be specified", 
        "type": "Sender"
    }, 
    "invocation": {
        "module_args": {
            "aws_access_key": null, 
            "aws_secret_key": null, 
            "cross_zone_load_balancing": null, 
            "deletion_protection": null, 
            "ec2_url": null, 
            "listeners": [
                {
                    "Certificates": null, 
                    "DefaultActions": [
                        {
                            "TargetGroupName": "stage-or1-std-http-edge-80", 
                            "Type": "forward"
                        }
                    ], 
                    "Port": 80, 
                    "Protocol": "TCP", 
                    "SslPolicy": null
                }, 
                {
                    "Certificates": null, 
                    "DefaultActions": [
                        {
                            "TargetGroupName": "stage-or1-std-http-edge-443", 
                            "Type": "forward"
                        }
                    ], 
                    "Port": 443, 
                    "Protocol": "TCP", 
                    "SslPolicy": null
                }
            ], 
            "name": "stage-or1-std-http-edge-2", 
            "profile": null, 
            "purge_listeners": true, 
            "purge_tags": true, 
            "region": "us-west-2", 
            "scheme": "internet-facing", 
            "security_token": null, 
            "state": "present", 
            "subnet_mappings": [
                {
                    "AllocationId": "eipalloc-4d6f3971", 
                    "SubnetId": "subnet-3f14c066"
                }, 
                {
                    "AllocationId": "eipalloc-0b6c3a37", 
                    "SubnetId": "subnet-fd4c9ab5"
                }
            ], 
            "subnets": null, 
            "tags": null, 
            "validate_certs": true, 
            "wait": null, 
            "wait_timeout": null
        }
    }, 
    "msg": "An error occurred (ValidationError) when calling the CreateLoadBalancer operation: At least one subnet must be specified", 
    "response_metadata": {
        "http_headers": {
            "connection": "close", 
            "content-length": "300", 
            "content-type": "text/xml", 
            "date": "Thu, 28 Jun 2018 17:20:04 GMT", 
            "x-amzn-requestid": "7f6e83a4-7af7-11e8-9084-b141012d5ac6"
        }, 
        "http_status_code": 400, 
        "request_id": "7f6e83a4-7af7-11e8-9084-b141012d5ac6", 
        "retry_attempts": 0
    }
}

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

elb_network_lb

ANSIBLE VERSION
ansible 2.7.0.dev0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/blamar/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/blamar/automation/venv/lib/python2.7/site-packages/ansible
  executable location = /home/blamar/automation/venv/bin/ansible
  python version = 2.7.9 (default, Apr 27 2015, 17:49:25) [GCC 4.6.3]
ADDITIONAL INFORMATION

To reproduce attempt to use the subnet_mappings feature of either an NLB or ALB.

After this change, NLBs and ALBs can be created with provided subnet mappings.

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Jun 28, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Jun 29, 2018
@mkrizek
Copy link
Contributor

mkrizek commented Jun 29, 2018

cc @s-hertel @ryansb

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 9, 2018
@blamarvt blamarvt closed this Jul 27, 2018
@blamarvt blamarvt reopened this Jul 27, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 27, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 6, 2018
@blamarvt blamarvt closed this Sep 13, 2018
@blamarvt blamarvt reopened this Sep 13, 2018
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 13, 2018
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 21, 2018
@Reagan
Copy link

Reagan commented Sep 24, 2018

+1 on this PR. I am facing this issue . Waiting for merge

@briantist
Copy link
Contributor

@Reagan see #42979

@ryansb ryansb closed this Oct 4, 2018
@ryansb ryansb reopened this Oct 4, 2018
@ryansb
Copy link
Contributor

ryansb commented Oct 4, 2018

Rebuilding

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 4, 2018
@ryansb ryansb merged commit 73133d7 into ansible:devel Oct 4, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. small_patch support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants