Perhaps you can try something a bit simpler? Note, not tested...
- name: Copy cert files to backup
shell: cp /var/certs/certbkup{*.crt *.cer *.jks *.p12} /var/certs/certbkup/
Kim
On Tuesday, July 19, 2016 at 9:57:44 AM UTC-6, Alan Harkleroad wrote:
>
> I am currently trying to copy a directories contents to a new directory so
> we can do our SHA-384 and TLS upgrades to the system. When I have to copy
> the variable list results to the new folder is where I am confusing my self
> as to how that should look
>
> My playbook likes like this.
>
> ---
> - hosts: some-server-name
> become: true
> become_method: sudo
> tasks:
>
> - name: Create backup directory on remote server/servers
> file: path=/var/certs/certbkup
> state=present
> owner=root
> group=some-group
> mode=744
>
> - name: list directory specific contents
> shell: ls *.crt *.cer *.jks *.p12 /var/certs
> register: cert_results
>
> - name: copy list results to new folder
> command: cp {{item}} /var/certs/certbkup
> with_items: cert_results.stdout_lines
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f98f921a-39ee-4515-957a-8fca007d1b32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.