<p dir="auto">Running ec2_elb_facts through a playbook generates the error below.</p>
<p dir="auto">ansible 2.0.0.2<br>
boto 2.38.0</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File &quot;/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts&quot;, line 2357, in &lt;module&gt;
    main()
  File &quot;/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts&quot;, line 193, in main
    list_elb(connection, module)
  File &quot;/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts&quot;, line 165, in list_elb
    elb_array.append(get_elb_info(elb))
  File &quot;/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts&quot;, line 144, in get_elb_info
    'health_check': get_health_check(elb.health_check),
  File &quot;/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts&quot;, line 124, in get_health_check
    'ping_port': int(port),
ValueError: invalid literal for int() with base 10: '443/healthtest/'"><pre class="notranslate"><code class="notranslate">An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts", line 2357, in &lt;module&gt;
    main()
  File "/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts", line 193, in main
    list_elb(connection, module)
  File "/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts", line 165, in list_elb
    elb_array.append(get_elb_info(elb))
  File "/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts", line 144, in get_elb_info
    'health_check': get_health_check(elb.health_check),
  File "/Users/robm/.ansible/tmp/ansible-tmp-1452917234.12-163996366850200/ec2_elb_facts", line 124, in get_health_check
    'ping_port': int(port),
ValueError: invalid literal for int() with base 10: '443/healthtest/'
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: localhost
  tasks:
    - action:
        module: ec2_elb_facts
        region: us-west-2
      register: elb_facts"><pre class="notranslate"><code class="notranslate">- hosts: localhost
  tasks:
    - action:
        module: ec2_elb_facts
        region: us-west-2
      register: elb_facts
</code></pre></div>
<h5 dir="auto">Issue Type:</h5>
<ul dir="auto">
<li>Bug Report</li>
<li>Bugfix Pull Request: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="123711538" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/1420" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible-modules-extras/pull/1420/hovercard" href="https://github.com/ansible/ansible-modules-extras/pull/1420">#1420</a></li>
</ul>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">Latest checkout from git (devel).</p>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">No changes</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Running on Mac OSX against AWS EC2 Ubuntu instances.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">In cloud/amazon/ec2_elb_facts.py:get_health_check,<br>
Ping Target parsing is currently broken  if the health-check path has more than one component e.g.:<br>
HTTP:80/api/v1/health_check. Python str split will separate this into more than 2 components and throw a ValueError exception (since it is trying to assign to 2). The assigment in the exception handler than causes port = '80/api/v1/health_check' which causes a failure when creating the dict.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Create an ELB with a health-check that has more than one component in the path ie HTTP:80/api/vi/health_check/ instead of HTTP:80/health_check</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">module should not fail in this use case</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ValueError: invalid literal for int() with base 10: '80/api/v1/health_check/'"><pre class="notranslate"><code class="notranslate">ValueError: invalid literal for int() with base 10: '80/api/v1/health_check/'
</code></pre></div>