]> git.phdru.name Git - ansible.git/commitdiff
Fix(debian-init-system): Combine uploading and extracting
authorOleg Broytman <phd@phdru.name>
Tue, 16 Jul 2019 00:13:48 +0000 (03:13 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 16 Jul 2019 18:28:42 +0000 (21:28 +0300)
Combine uploading and extracting in one step using module `unarchive`.
Extract directly to `/home/phd`.

playbooks/roles/debian-phd/tasks/setup-home.yml

index 9d6b1cd766c8f9d67138dc9f3e031afb04cc2be5..a000aec35c14a140b455f949c9c9743f5b7d1178 100644 (file)
@@ -1,16 +1,4 @@
-- name: Upload archive
-  copy:
+- name: Upload and extract archive
+  unarchive:
     src: ~/archive/STORE/phd/Home/phd.tar.bz2
-    dest: /tmp
-
-- name: Extract archive
-  shell: "cd /tmp && bzcat phd.tar.bz2 | tar xf -"
-
-- name: Copy home
-  command: rsync -a /tmp/phd /home
-
-- name: Cleanup
-  file:
-    path: "{{ item }}"
-    state: absent
-  loop: ['/tmp/phd', '/tmp/phd.tar.bz2']
+    dest: /home