Prechádzať zdrojové kódy

[direnv] Add a direnv role

Colin Powell 3 rokov pred
rodič
commit
abb771c3a7
1 zmenil súbory, kde vykonal 24 pridanie a 0 odobranie
  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