<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<p dir="auto">Appears to be similar to 32053 which is closed:<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="267806863" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/32053" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible/pull/32053/hovercard" href="https://github.com/ansible/ansible/pull/32053">#32053</a></p>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">URI</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ca-spollockmb1:fs-skytap-control spollock$ ansible --version
ansible 2.5.0
  config file = /Users/spollock/ansible/fs-skytap-control/ansible.cfg
  configured module search path = [u'/Users/spollock/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
ca-spollockmb1:fs-skytap-control spollock$ python --version
Python 2.7.10
"><pre class="notranslate"><code class="notranslate">ca-spollockmb1:fs-skytap-control spollock$ ansible --version
ansible 2.5.0
  config file = /Users/spollock/ansible/fs-skytap-control/ansible.cfg
  configured module search path = [u'/Users/spollock/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
ca-spollockmb1:fs-skytap-control spollock$ python --version
Python 2.7.10

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">ansible-config dump --only-changed<br>
DEFAULT_REMOTE_PORT(/Users/spollock/ansible/fs-skytap-control/ansible.cfg) = 22<br>
DEFAULT_REMOTE_USER(/Users/spollock/ansible/fs-skytap-control/ansible.cfg) = spollock<br>
DEFAULT_TIMEOUT(/Users/spollock/ansible/fs-skytap-control/ansible.cfg) = 30<br>
RETRY_FILES_ENABLED(/Users/spollock/ansible/fs-skytap-control/ansible.cfg) = False</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">OSX 10.11.6</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto">Throwing an error when connecting to an HTTPS site.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
- name: Generate the Report
  uri:
    url: https://cloud.skytap.com/auditing/exports.json
    method: POST
    user: &quot;{{ skytapuser }}&quot;
    password: &quot;{{ skytapapitoken }}&quot;
    force_basic_auth: yes
    body_format: json
    validate_certs: no

"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Generate the Report</span>
  <span class="pl-ent">uri</span>:
    <span class="pl-ent">url</span>: <span class="pl-s">https://cloud.skytap.com/auditing/exports.json</span>
    <span class="pl-ent">method</span>: <span class="pl-s">POST</span>
    <span class="pl-ent">user</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ skytapuser }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">password</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ skytapapitoken }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">force_basic_auth</span>: <span class="pl-s">yes</span>
    <span class="pl-ent">body_format</span>: <span class="pl-s">json</span>
    <span class="pl-ent">validate_certs</span>: <span class="pl-s">no</span>

</pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">Should have returned status = 200</p>
<p dir="auto">Tested exact same config with POSTMAN and it works fine.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
atal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;content&quot;: &quot;&quot;, &quot;msg&quot;: &quot;Status code was not [200]: Request failed: &lt;urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)&gt;&quot;, &quot;redirected&quot;: false, &quot;status&quot;: -1, &quot;url&quot;: &quot;https://cloud.skytap.com/auditing/exports.json&quot;}

"><pre class="notranslate"><code class="notranslate">
atal: [localhost]: FAILED! =&gt; {"changed": false, "content": "", "msg": "Status code was not [200]: Request failed: &lt;urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)&gt;", "redirected": false, "status": -1, "url": "https://cloud.skytap.com/auditing/exports.json"}


</code></pre></div>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.6 (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/c09e46517e93bbf4906728063cb9139fc5ae85e2/hovercard" href="https://github.com/ansible/ansible/commit/c09e46517e93bbf4906728063cb9139fc5ae85e2"><tt>c09e465</tt></a>) last updated 2014/03/17 14:53:17 (GMT -500)</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">OS X 10.9.2 against Centos 5/6, Ubuntu 12.04/13.10, *BSD, Solaris.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">While testing out a PR I came across this traceback when just trying to duplicate the examples from the assemble module. It looks like this is related to the escaping of '#' when in a KEY=VAL when running a module. May relate to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28755557" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/6287" data-hovercard-type="pull_request" data-hovercard-url="/ansible/ansible/pull/6287/hovercard" href="https://github.com/ansible/ansible/pull/6287">GH-6287</a></p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Execute a task as such:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
---
- name: Copy the files out to the remote.
  copy: src=test_config.d dest=/tmp/

- name: Assemble the test.conf file from local files.
  assemble: src=/tmp/test_config.d dest=/tmp/local_test.config

- name: Assemble the test.conf file with a delimiter from local files.
  assemble: src=/tmp/test_config.d dest=/tmp/local_test-w-del.config delimiter='### Fragment Boundry  ###'

- name: Assemble the test.conf file from remote files.
  assemble: remote_src=False src=test_config.d dest=/tmp/remote_test.config

- name: Assemble the test.conf file with a delimiter from remote files.
  assemble: remote_src=False src=test_config.d dest=/tmp/remote_test-w-del.config delimiter='### Fragment Boundry  ###'"><pre class="notranslate">---
- <span class="pl-ent">name</span>: <span class="pl-s">Copy the files out to the remote.</span>
  <span class="pl-ent">copy</span>: <span class="pl-s">src=test_config.d dest=/tmp/</span>

- <span class="pl-ent">name</span>: <span class="pl-s">Assemble the test.conf file from local files.</span>
  <span class="pl-ent">assemble</span>: <span class="pl-s">src=/tmp/test_config.d dest=/tmp/local_test.config</span>

- <span class="pl-ent">name</span>: <span class="pl-s">Assemble the test.conf file with a delimiter from local files.</span>
  <span class="pl-ent">assemble</span>: <span class="pl-s">src=/tmp/test_config.d dest=/tmp/local_test-w-del.config delimiter='### Fragment Boundry  </span><span class="pl-c"><span class="pl-c">#</span>##'</span>

- <span class="pl-ent">name</span>: <span class="pl-s">Assemble the test.conf file from remote files.</span>
  <span class="pl-ent">assemble</span>: <span class="pl-s">remote_src=False src=test_config.d dest=/tmp/remote_test.config</span>

- <span class="pl-ent">name</span>: <span class="pl-s">Assemble the test.conf file with a delimiter from remote files.</span>
  <span class="pl-ent">assemble</span>: <span class="pl-s">remote_src=False src=test_config.d dest=/tmp/remote_test-w-del.config delimiter='### Fragment Boundry  </span><span class="pl-c"><span class="pl-c">#</span>##'</span></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Files are assembled with "### Fragment Boundry  ###" marking the original boundaries.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK: [test_assemble | Assemble the test.conf file.] ************************** 
fatal: [test-debian7] =&gt; Traceback (most recent call last):
  File &quot;/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py&quot;, line 516, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File &quot;/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py&quot;, line 606, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File &quot;/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py&quot;, line 801, in _executor_internal_inner
    result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
  File &quot;/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/action_plugins/assemble.py&quot;, line 61, in run
    options.update(utils.parse_kv(module_args))
  File &quot;/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/utils/__init__.py&quot;, line 542, in parse_kv
    vargs = [x.decode('utf-8') for x in shlex.split(args, posix=True)]
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py&quot;, line 279, in split
    return list(lex)
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py&quot;, line 269, in next
    token = self.get_token()
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py&quot;, line 96, in get_token
    raw = self.read_token()
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py&quot;, line 172, in read_token
    raise ValueError, &quot;No closing quotation&quot;
ValueError: No closing quotation"><pre class="notranslate"><code class="notranslate">TASK: [test_assemble | Assemble the test.conf file.] ************************** 
fatal: [test-debian7] =&gt; Traceback (most recent call last):
  File "/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py", line 516, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py", line 606, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File "/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/__init__.py", line 801, in _executor_internal_inner
    result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
  File "/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/runner/action_plugins/assemble.py", line 61, in run
    options.update(utils.parse_kv(module_args))
  File "/Users/ri/repos/github.com/risaacson/ansible/lib/ansible/utils/__init__.py", line 542, in parse_kv
    vargs = [x.decode('utf-8') for x in shlex.split(args, posix=True)]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 279, in split
    return list(lex)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation
</code></pre></div>