Explorar o código

[direnv] Add a direnv role

Colin Powell %!s(int64=3) %!d(string=hai) anos
pai
achega
abb771c3a7
Modificáronse 1 ficheiros con 24 adicións e 0 borrados
  1. 24 0
      ansible/roles/direnv/tasks/main.yml

+ 24 - 0
ansible/roles/direnv/tasks/main.yml

@@ -0,0 +1,24 @@
+---
+- name: Dependencies installed
+  community.general.pkgng:
+    name: direnv,bash
+    state: latest
+
+- name: Ensured bashrc file exists
+  copy:
+    content: ""
+    dest: /root/.bashrc
+    force: no
+    owner: root
+    mode: 0644
+
+- name: Updated bashrc for direnv for root user
+  lineinfile:
+    dest: /root/.bashrc
+    line: 'eval "$(direnv hook bash)"'
+    owner: root
+
+- name: Set root shell to Bash
+  user:
+    name: root
+    shell: /usr/local/bin/bash