Hey all,

i'm trying to write a task to manage ssh keys. depending on that the 
ansible_user, i want teo work either in /root/.ssh or /home/$user/.ssh. So 
I naively googled how to do that and only ended confused with


- set_fact: userdir="/home/{{ ansible_user }}"
  when: ssh_keygen_user != "root"
- set_fact: userdir="/root"
  when: ssh_keygen_user == "root"

- name: Check .ssh dir
  file: path={{ userdir }}/.ssh state=directory mode=0700 owner={{ 
ansible_user }} group={{ ansible_user }}

when playing this, if fails because "path": "/home//.ssh", so obviously i'm 
not passing the right values. could you help out please? thanks in 
adavance, P.


-- 
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/44b3de9d-3240-425d-862a-009db676e1a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to