- name: Test if user phd already exists command: test -f ~/.profile -a -f ~/.shellrc failed_when: false register: phd_exist - debug: msg: "User phd has already been created" when: phd_exist.rc == 0 - name: Create and setup user phd block: - name: Create user phd import_tasks: create.yml - name: Upload and extract home archive unarchive: src: ~/archive/STORE/phd/Home/phd.tar.bz2 dest: /home when: phd_exist.rc != 0