<p dir="auto">please add 'raw' to modules allowed to have duplicate parameters.</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/ansible/ansible/blob/be4dbe76b9fbdd7e377f0d0c3ace61fa6e855e04/lib/ansible/runner/__init__.py#L444">ansible/lib/ansible/runner/__init__.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 444
      in
      <a data-pjax="true" class="commit-tease-sha" href="/ansible/ansible/commit/be4dbe76b9fbdd7e377f0d0c3ace61fa6e855e04">be4dbe7</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L444" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="444"></td>
          <td id="LC444" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">is_shell_module</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-s1">module_name</span> <span class="pl-c1">in</span> (<span class="pl-s">'command'</span>, <span class="pl-s">'shell'</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- is_shell_module = self.module_name in ('command', 'shell')
+ is_shell_module = self.module_name in ('command', 'shell', 'raw')"><pre class="notranslate"><code class="notranslate">- is_shell_module = self.module_name in ('command', 'shell')
+ is_shell_module = self.module_name in ('command', 'shell', 'raw')
</code></pre></div>
<p dir="auto">thank you.</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Feature Idea</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">1.6.6</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">I developed a lookup plugin which is for pulling secret keys from the cloud server. However, when I use <code class="notranslate">with_secret</code> statement like this</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: foo
  bar: secret={{ item }}
  with_secret: eggs/spam/secret.txt"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">foo</span>
  <span class="pl-ent">bar</span>: <span class="pl-s">secret={{ item }}</span>
  <span class="pl-ent">with_secret</span>: <span class="pl-s">eggs/spam/secret.txt</span></pre></div>
<p dir="auto">and you will see something like this on the screen when you run ansible</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ok: [default] =&gt; (item=&quot;MY_SUPER_SECRET_KEY_HERE&quot;)"><pre class="notranslate"><code class="notranslate">ok: [default] =&gt; (item="MY_SUPER_SECRET_KEY_HERE")
</code></pre></div>
<p dir="auto">I really don't like how this works, it displays your secret key on screen. If you redirect logging for ansible to a file or what, then all your secret keys are in the file now.</p>
<p dir="auto">And in other situations, like with_file, you may see something like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ok: [default] =&gt; (item=&quot;
thousand lines here
thousand lines here
thousand lines here
thousand lines here
thousand lines here
...."><pre class="notranslate"><code class="notranslate">ok: [default] =&gt; (item="
thousand lines here
thousand lines here
thousand lines here
thousand lines here
thousand lines here
....
</code></pre></div>
<p dir="auto">I think this is really bad for ansible to print literately everything it got from a lookup. So, I propose, for a lookup class, if a <code class="notranslate">sanitize</code> method is defined, ansible should then call the method for each item before printing it on the screen. So that for my secret getting lookup I can write something like this</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="def sanitize(self, item):
    return '*' * 8"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">sanitize</span>(<span class="pl-s1">self</span>, <span class="pl-s1">item</span>):
    <span class="pl-k">return</span> <span class="pl-s">'*'</span> <span class="pl-c1">*</span> <span class="pl-c1">8</span></pre></div>
<p dir="auto">And for huge file and other things, people can write something like</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="def sanitize(self, item):
    return 'File {} ({} bytes)'.format(item._filename, item._size)

def run(self, terms, inject=None, **kwargs):
    result = 'a long long long long file content'
    result._filename = terms
    result._size = len(result)
    return [result]"><pre class="notranslate"><span class="pl-k">def</span> <span class="pl-en">sanitize</span>(<span class="pl-s1">self</span>, <span class="pl-s1">item</span>):
    <span class="pl-k">return</span> <span class="pl-s">'File {} ({} bytes)'</span>.<span class="pl-en">format</span>(<span class="pl-s1">item</span>.<span class="pl-s1">_filename</span>, <span class="pl-s1">item</span>.<span class="pl-s1">_size</span>)

<span class="pl-k">def</span> <span class="pl-en">run</span>(<span class="pl-s1">self</span>, <span class="pl-s1">terms</span>, <span class="pl-s1">inject</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>):
    <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s">'a long long long long file content'</span>
    <span class="pl-s1">result</span>.<span class="pl-s1">_filename</span> <span class="pl-c1">=</span> <span class="pl-s1">terms</span>
    <span class="pl-s1">result</span>.<span class="pl-s1">_size</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">result</span>)
    <span class="pl-k">return</span> [<span class="pl-s1">result</span>]</pre></div>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">N/A</p>