---
- hosts: "{{ lookup('env', 'DFDISTRIB') }}"
  gather_facts: false
  vars:
    ansible_python_interpreter: "auto_silent"
  tasks:
    - name: "Copy dotfiles.tar.xz to remote"
      copy:
        src: "dotfiles.tar.xz"
        dest: "~/dotfiles.tar.xz"
        mode: "0640"
      tags:
        - "remote"
        - "all"
    - name: "Unpack dotfiles.tar.xz"
      unarchive:
        dest: "~/"
        src: "dotfiles.tar.xz"
        remote_src: "yes"
        list_files: "yes"
      tags:
        - "unpack"
        - "all"
    - name: "Remove tarball on remote"
      file:
        path: "~/dotfiles.tar.xz"
        state: "absent"
      tags:
        - "never"
        - "removal"