On 24. juli 2016 10:54, samir patry wrote:
I am using assemble module to make one file from multiple files. I have a
list of files and from that list I want only .pub files to be assembled,
but I am not sure how to use this.


list of files:

root_rsa_comiskey-v01
root_rsa_comiskey-v01.pub
root_rsa_comiskey-v02
root_rsa_comiskey-v02.pub
root_rsa_comiskey-v03
root_rsa_comiskey-v03.pub
root_rsa_comiskey-v05
root_rsa_comiskey-v05.pub


Playbook file:

---
- hosts: localhost
  become_user: yes
  tasks:
  - name: list files
    shell: ls -1 /tmp/root_ssh_key*
    register: dumpfiles

  - name: fetch files
    assemble: src=/tmp/root_ssh_key/ dest=/tmp/root_ssh_key/id_rsa 
regexp='(*.pub)'
    register: test

You only need to change your regexp, this should work
regexp='.*\.pub$'

--
Kai Stian Olstad

--
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/3469bbc9-7a8e-b11c-5913-a351b4a82368%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to