title: Getting Error for Copy Task in Ansible Playbook
body: <p>I'm trying to copy a file on the remote server to the same filename with &quot;.old&quot; appended - so file.crt will have a copy called file.crt.old.</p>
  <p>I have a playbook with the following statements:</p>
  <pre><code>---
  - name: Copy current certificate files to 'old' for the PostgreSQL servers
    hosts: all
    become: true
    become_user: postgres
    tasks:
      - name: Copy file
        ansible.builtin.copy:
          remote_src: yes
          src: /&lt;abs path&gt;/Config/file.crt
          dest: /&lt;abs path&gt;/Config/file/server.crt.old
  
        register: query1
        args:
          warn: no
  
      - debug: msg=&quot;{{ query1.stdout_lines }}&quot;
  </code></pre>
  <p>I execute the playbook with the following command:</p>
  <pre><code>ansible-playbook pg_ckCerts3.yml --ask-become-pass --limit &lt;server name&gt; &gt; test.txt
  </code></pre>
  <p>I keep getting the following error:</p>
  <pre><code>TASK [Copy file] *****************************************************************************************************
  fatal: [server name]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;msg&quot;: &quot;Unsupported parameters for (copy) module: warn Supported parameters include: _original_basename, attributes, backup, checksum, content, delimiter, dest, directory_mode, follow, force, group, local_follow, mode, owner, regexp, remote_src, selevel, serole, setype, seuser, src, unsafe_writes, validate&quot;}
  </code></pre>
  <p>Can anyone tell me what is wrong with my playbook?  I've tried it a dozen different ways ... with quotes around the filenames &amp; without, yes or true for remote_src, with copy &amp; with ansible.builtin.copy, remote_src specified first or last.  No matter what, I keep getting the same error.</p>
  <p>Once I get it working, I actually want to copy more than one file - both the file.crt &amp; the file.key files &amp; then list out the files to verify, so if anyone can also help with that, it would  also be greatly appreciated.</p>
  <p>I normally use the following code to list out files, but I can't seem to do more than one task in a playbook at a time:</p>
  <pre><code>...
    tasks:
      - name: Get hostname, list current certificate files
        shell: |
          hostname
          echo -e &quot;\nCurrent cert files:&quot;
          ls -l --time-style=long-iso /var/lib/pgsql/*/*/&lt;filename&gt;*
  
        register: query1
        args:
          warn: no
  
      - debug: msg=&quot;{{ query1.stdout_lines }}&quot;
  </code></pre>
  <p>Thanks,
  Karin</p>