Hello,

got the following contents in a dir(/usr/java):
#lrwxrwxrwx 1 root root   16 Jul  4  2016 default -> /usr/java/latest
#drwxr-xr-x 8 root root 4096 Mar 17  2017 jdk1.8.0_121
#drwxr-xr-x 8 root root 4096 Jul 12 13:41 jdk1.8.0_141
#drwxr-xr-x 8 root root 4096 Apr  1  2016 jdk1.8.0_92
#lrwxrwxrwx 1 root root   22 Sep 15 14:29 latest -> /usr/java/jdk1.8.0_141

With:
  - name: Find links pointing to java installations in {{ java_install_dir 
}}
    find:
      paths: "{{ java_install_dir }}"
      file_type: link
      patterns: "^(default|latest).*$"
      use_regex: yes
    register: links
i get 2 results. It' fine.

With:
...
      patterns: "^(default|latest).*jdk.*$"
...
I get no results.
With:
...
      patterns: "^(default|latest).*$"
      contains: "jdk" # yes, a dirty try checking link content
...
i get 2 results.

My goal is to get only one result(latest). What do i do wrong? Thank you 
for any suggests.

-- 
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/fcca009a-1b75-4a2f-9200-882cb8c55ccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to