Dot_Files/roles/zsh/tasks/install-autojump.yml

38 lines
1.1 KiB
YAML
Raw Normal View History

2022-08-01 00:42:23 -05:00
---
- name: Check if Autojump Installed
2022-08-01 01:48:49 -05:00
ansible.builtin.command: which autojump
2022-08-01 00:42:23 -05:00
changed_when: false
register: autojump_installed
2022-08-01 01:48:49 -05:00
failed_when: autojump_installed.rc > 1
2022-08-01 00:42:23 -05:00
- name: Set Autojump git destination
ansible.builtin.set_fact:
autojump_git_dest: /tmp/autojump
- name: Get Autojump from Git
ansible.builtin.git:
repo: "{{ autojump_git_repo | default('https://github.com/wting/autojump.git') }}"
dest: "{{ autojump_git_dest }}"
version: "{{ autojump_git_version | default('release-v22.5.3') }}"
force: true
when: autojump_installed.rc != 0
- name: Set Autojump install path if not set
ansible.builtin.set_fact:
2022-08-01 01:48:49 -05:00
auto_jump_install_path: "{{ xdg_data_home + '/autojump' }}"
2022-08-01 00:42:23 -05:00
- name: Install Autojump
ansible.builtin.command:
argv:
2022-08-01 01:54:03 -05:00
- python3 "{{ autojump_git_dest }}/install.py"
2022-08-01 00:42:23 -05:00
- -d
- "{{ auto_jump_install_path }}"
changed_when: true
when: autojump_installed.rc != 0
- name: Ensure Autojump Uses Python3
ansible.builtin.lineinfile:
path: "{{ auto_jump_install_path }}/bin/autojump"
regexp: "#!.* python$"
line: "#!/usr/bin/env python3"
when: autojump_installed.rc != 0