]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/phd/tasks/main.yml
Feat: Use `changed_when` to avoid reporting changes
[ansible.git] / playbooks / debian / roles / phd / tasks / main.yml
1 - name: Test if user phd already exists
2   command: test -f ~/.profile -a -f ~/.shellrc
3   failed_when: false
4   register: phd_exist
5   changed_when: phd_exist.rc != 0
6
7 - debug:
8     msg: "User phd has already been created"
9   when: phd_exist.rc == 0
10
11 - name: Create and setup user phd
12   block:
13     - name: Create user phd
14       import_tasks: create.yml
15     - name: Upload and extract home archive
16       unarchive:
17         src: ~/archive/STORE/phd/Home/phd.tar.bz2
18         dest: /home
19   when: phd_exist.rc != 0