---
- name: Download
  get_url:
    url: "{{ fasd_url }}"
    dest: "{{ fasd_tar_gz }}"

- name: Extract
  unarchive:
    src: "{{ fasd_tar_gz }}"
    dest: "/home/deploy"

- name: Install
  environment:
    HOME: "/home/deploy"
  shell: "make install chdir={{ fasd_path }}"
  become: True
  become_user: root

- name: Ensure bash_profile exists
  file:
    path: "{{ bash_profile }}"
    state: file

- name: Add to bash_profile
  lineinfile:
    line: 'eval "$(fasd --init auto)"'
    dest: "{{ bash_profile }}"
    state: present

- name: Delete fasd_path
  file:
    path: "{{ fasd_path }}"
    state: absent

- name: Delete tarfile
  file:
    path: "{{ fasd_tar_gz }}"
    state: absent

---
- name: Download
  get_url:
    url: "{{ fasd_url }}"
    dest: "{{ fasd_tar_gz }}"

- name: Extract
  unarchive:
    src: "{{ fasd_tar_gz }}"
    dest: "/home/deploy"

- name: Install
  environment:
    HOME: "/home/deploy"
  shell: "make install chdir={{ fasd_path }}"
  become: True
  become_user: root

- name: Ensure bash_profile exists
  file:
    path: "{{ bash_profile }}"
    state: file

- name: Add to bash_profile
  lineinfile:
    line: 'eval "$(fasd --init auto)"'
    dest: "{{ bash_profile }}"
    regexp: EOF
    state: present

- name: Delete fasd_path
  file:
    path: "{{ fasd_path }}"
    state: absent

- name: Delete tarfile
  file:
    path: "{{ fasd_tar_gz }}"
    state: absent

Append fasd initialization in bash_profile
Append fasd initialization in bash_profile
