From 9872fbdaf7d4c1cd186b6313aa0ee0e3c8bf98a6 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 3 Aug 2022 01:35:21 -0500 Subject: [PATCH] Revert "refactor: improve direnv installer" This reverts commit f9868fd3885fbfa9d691eeabf68b96694266f5b2. --- roles/zsh/tasks/install-direnv.yml | 41 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/roles/zsh/tasks/install-direnv.yml b/roles/zsh/tasks/install-direnv.yml index a5964c7..44613ad 100644 --- a/roles/zsh/tasks/install-direnv.yml +++ b/roles/zsh/tasks/install-direnv.yml @@ -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'