Maybe use register variables; something like:

- name: test user home dir in HDFS
  shell: hadoop fs -test -d /user/{{ item.name }}
  register: hadoop_dir

- name: create user home dir in HDFS
  shell: hadoop fs -mkdir /user/{{ item.name }}
  when: hadoop_dir|failed
  
- name: chown user home dir in HDFS  
  hadoop fs -chown {{ item.name }} /user/{{ item.name }})
  when: hadoop_dir|failed

-- 
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/c7eee9fa-26e8-4fc2-a719-19b14f33704f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to