Hello!

Here is the problem:

- name: Check for RSA-Key existence
  stat:
    path: /opt/cert/{{item.username}}.key
  with_items: "{{roles}}"
  register: rsa

- name: debug
  debug:
    var: item.stat.exists
  loop: "{{rsa.results}}"

- name: Generate RSA-Key
  community.crypto.openssl_privatekey:
    path: /opt/cert/{{item.username}}.key
    size: 2048
  when: item.stat.exists == False
  with_items:
    - "{{roles}}"
    - "{{rsa.results}}"

The error that i received - The error was: error while evaluating 
conditional (item.stat.exists == False): 'dict object' has no attribute 
'stat'

Debug task goes just well - "item.stat.exists": true

I am beating around this about 2 days already... What am i dooing wrong and 
how to make this work?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f103126d-ed49-4f33-a25f-c4d18ebf0a5dn%40googlegroups.com.

Reply via email to