Revert "refactor: improve direnv installer"

This reverts commit f9868fd388.
This commit is contained in:
Price Hiller 2022-08-03 01:35:21 -05:00
parent f9868fd388
commit 9872fbdaf7

View File

@ -1,25 +1,22 @@
---
- name: Check if direnv installed
ansible.builtin.stat:
path: "{{ xdg_bin_home }}/direnv"
register: direnv_installed
changed_when: false
- name: Install direnv for Arch
community.general.pacman:
name:
- direnv
state: present
when: ansible_facts.distribution == 'Archlinux'
- name: Create direnv working dir
ansible.builtin.tempfile:
state: directory
register: direnv_work_dir
when: not direnv_installed.stat.exists
- name: Install direnv for Debian based systems
become: true
ansible.builtin.apt:
name:
- direnv
state: present
when: ansible_facts.os_family == 'Debian'
- name: Download direnv installer script
ansible.builtin.get_url:
url: https://direnv.net/install.sh
dest: "{{ direnv_work_dir.path }}/install.sh"
mode: 744
when: not direnv_installed.stat.exists
- name: Install direnv
ansible.builtin.command: "bash {{ direnv_work_dir.path }}/install.sh"
environment:
bin_path: "{{ xdg_bin_home }}"
when: not direnv_installed.stat.exists
- name: Install direnv for MacOS
community.general.homebrew:
name:
- direnv
state: present
when: ansible_facts.distribution == 'MacOSX'