<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">zypper_module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I have in a role a tasks/main.yml which contains:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  - include: library/setup_packages.yml
    vars:
      pkg:   &quot;{{ item }}&quot;
      state: present
    with_items:
      - &quot;{{ wanted_packages | default([]) }}&quot;
    tags:
      - packages"><pre class="notranslate">  - <span class="pl-ent">include</span>: <span class="pl-s">library/setup_packages.yml</span>
    <span class="pl-ent">vars</span>:
      <span class="pl-ent">pkg</span>:   <span class="pl-s"><span class="pl-pds">"</span>{{ item }}<span class="pl-pds">"</span></span>
      <span class="pl-ent">state</span>: <span class="pl-s">present</span>
    <span class="pl-ent">with_items</span>:
      - <span class="pl-s"><span class="pl-pds">"</span>{{ wanted_packages | default([]) }}<span class="pl-pds">"</span></span>
    <span class="pl-ent">tags</span>:
      - <span class="pl-s">packages</span></pre></div>
<p dir="auto">and a library/setup_packages.yml which contains:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
  - debug:
      msg:   &quot;{{ pkg }} -&gt; {{ state }}&quot;

  - zypper:
      pkg:   &quot;{{ pkg }}&quot;
      state: &quot;{{ state }}&quot;"><pre class="notranslate">---
  - <span class="pl-ent">debug</span>:
      <span class="pl-ent">msg</span>:   <span class="pl-s"><span class="pl-pds">"</span>{{ pkg }} -&gt; {{ state }}<span class="pl-pds">"</span></span>

  - <span class="pl-ent">zypper</span>:
      <span class="pl-ent">pkg</span>:   <span class="pl-s"><span class="pl-pds">"</span>{{ pkg }}<span class="pl-pds">"</span></span>
      <span class="pl-ent">state</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ state }}<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">When I call this with a list wanted_packages like this:<br>
wanted_packages:</p>
<ul dir="auto">
<li>rlwrap=0.37-2.1</li>
</ul>
<p dir="auto">This fails for me because there are two versions of rlwrap in the repository directory. Only the older one is installable in my context. So I tried to set a specific version. But the zypper module generates a commandline with both  "rlwrap=0.37-2.1" AND "rlwrap" which leads into a failure.<br>
The output is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [oracle : debug] **********************************************************
ok: [hhlokora12-tpl] =&gt; {
    &quot;msg&quot;: &quot;rlwrap=0.37-2.1 -&gt; present&quot;
}

TASK [oracle : zypper] *********************************************************
fatal: [hhlokora12-tpl]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;cmd&quot;: [&quot;/usr/bin/zypper&quot;, &quot;--quiet&quot;, &quot;--non-interactive&quot;, &quot;--xmlout&quot;, &quot;install&quot;, &quot;--type&quot;, &quot;package&quot;, &quot;--auto-agree-with-licenses&quot;, &quot;--no-recommends&quot;, &quot;--oldpackage&quot;, &quot;--&quot;, &quot;rlwrap=0.37-2.1&quot;, &quot;rlwrap&quot;], &quot;failed&quot;: true, &quot;msg&quot;: &quot;Zypper run command failed with return code 4.&quot;, &quot;rc&quot;: 4, &quot;stderr&quot;: &quot;&quot;, &quot;stdout&quot;: &quot;&lt;?xml version='1.0'?&gt;\n&lt;stream&gt;\n&lt;prompt id=\&quot;1\&quot;&gt;\n&lt;description&gt;Problem: nothing provides libreadline.so.5()(64bit) needed by rlwrap-0.42-24.1.x86_64\n Solution 1: do not install rlwrap-0.42-24.1.x86_64\n Solution 2: break rlwrap-0.42-24.1.x86_64 by ignoring some of its dependencies\n&lt;/description&gt;\n&lt;text&gt;Choose from above solutions by number or cancel&lt;/text&gt;\n&lt;option value=\&quot;1\&quot; desc=\&quot;\&quot;/&gt;\n&lt;option value=\&quot;2\&quot; desc=\&quot;\&quot;/&gt;\n&lt;option default=\&quot;1\&quot; value=\&quot;c\&quot; desc=\&quot;\&quot;/&gt;\n&lt;/prompt&gt;\n&lt;/stream&gt;\n&quot;, &quot;stdout_lines&quot;: [&quot;&lt;?xml version='1.0'?&gt;&quot;, &quot;&lt;stream&gt;&quot;, &quot;&lt;prompt id=\&quot;1\&quot;&gt;&quot;, &quot;&lt;description&gt;Problem: nothing provides libreadline.so.5()(64bit) needed by rlwrap-0.42-24.1.x86_64&quot;, &quot; Solution 1: do not install rlwrap-0.42-24.1.x86_64&quot;, &quot; Solution 2: break rlwrap-0.42-24.1.x86_64 by ignoring some of its dependencies&quot;, &quot;&lt;/description&gt;&quot;, &quot;&lt;text&gt;Choose from above solutions by number or cancel&lt;/text&gt;&quot;, &quot;&lt;option value=\&quot;1\&quot; desc=\&quot;\&quot;/&gt;&quot;, &quot;&lt;option value=\&quot;2\&quot; desc=\&quot;\&quot;/&gt;&quot;, &quot;&lt;option default=\&quot;1\&quot; value=\&quot;c\&quot; desc=\&quot;\&quot;/&gt;&quot;, &quot;&lt;/prompt&gt;&quot;, &quot;&lt;/stream&gt;&quot;]}"><pre class="notranslate"><code class="notranslate">TASK [oracle : debug] **********************************************************
ok: [hhlokora12-tpl] =&gt; {
    "msg": "rlwrap=0.37-2.1 -&gt; present"
}

TASK [oracle : zypper] *********************************************************
fatal: [hhlokora12-tpl]: FAILED! =&gt; {"changed": false, "cmd": ["/usr/bin/zypper", "--quiet", "--non-interactive", "--xmlout", "install", "--type", "package", "--auto-agree-with-licenses", "--no-recommends", "--oldpackage", "--", "rlwrap=0.37-2.1", "rlwrap"], "failed": true, "msg": "Zypper run command failed with return code 4.", "rc": 4, "stderr": "", "stdout": "&lt;?xml version='1.0'?&gt;\n&lt;stream&gt;\n&lt;prompt id=\"1\"&gt;\n&lt;description&gt;Problem: nothing provides libreadline.so.5()(64bit) needed by rlwrap-0.42-24.1.x86_64\n Solution 1: do not install rlwrap-0.42-24.1.x86_64\n Solution 2: break rlwrap-0.42-24.1.x86_64 by ignoring some of its dependencies\n&lt;/description&gt;\n&lt;text&gt;Choose from above solutions by number or cancel&lt;/text&gt;\n&lt;option value=\"1\" desc=\"\"/&gt;\n&lt;option value=\"2\" desc=\"\"/&gt;\n&lt;option default=\"1\" value=\"c\" desc=\"\"/&gt;\n&lt;/prompt&gt;\n&lt;/stream&gt;\n", "stdout_lines": ["&lt;?xml version='1.0'?&gt;", "&lt;stream&gt;", "&lt;prompt id=\"1\"&gt;", "&lt;description&gt;Problem: nothing provides libreadline.so.5()(64bit) needed by rlwrap-0.42-24.1.x86_64", " Solution 1: do not install rlwrap-0.42-24.1.x86_64", " Solution 2: break rlwrap-0.42-24.1.x86_64 by ignoring some of its dependencies", "&lt;/description&gt;", "&lt;text&gt;Choose from above solutions by number or cancel&lt;/text&gt;", "&lt;option value=\"1\" desc=\"\"/&gt;", "&lt;option value=\"2\" desc=\"\"/&gt;", "&lt;option default=\"1\" value=\"c\" desc=\"\"/&gt;", "&lt;/prompt&gt;", "&lt;/stream&gt;"]}
</code></pre></div>
<p dir="auto">Why is it expanding to both?<br>
If it is needed a switch like exact_version or so which leads only to the specific version would be nice.</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=""><pre class="notranslate"></pre></div>

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

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


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.0.1.0
  config file = /home/ansible/.ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.0.1.0
  config file = /home/ansible/.ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Trying to delete multiple files</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Cleanup install scripts and binaries
        file: path={{ target_path }}/xxx.bin state=absent
        file: path={{ target_path }}/yyy.ksh state=absent
        file: path={{ target_path }}/zzz state=absent

"><pre class="notranslate"><code class="notranslate">- name: Cleanup install scripts and binaries
        file: path={{ target_path }}/xxx.bin state=absent
        file: path={{ target_path }}/yyy.ksh state=absent
        file: path={{ target_path }}/zzz state=absent


</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Able to delete multiple files</p>
<h5 dir="auto">ACTUAL RESULTS</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="only one of the three files are removed."><pre class="notranslate"><code class="notranslate">only one of the three files are removed.
</code></pre></div>
<p dir="auto">I have done some deep googling with little success</p>
<p dir="auto">Thanks</p>