Skip to content

Commit 911c711

Browse files
committed
feat: add direnv role
1 parent 8884fc8 commit 911c711

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This Ansible collection provides a set of roles designed for configuring Kubuntu
1010
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
1111
| [xebis.ansible.apt](roles/apt/README.md) | Deb package updates and upgrades using the apt package manager. Can optionally clean up unused packages and reboot the system if required. | `xebis.ansible.system` |
1212
| [`xebis.ansible.coding_projects`](roles/coding_projects/README.md) | Creates and clones coding projects to `~/Projects` | `xebis.ansible.apt` |
13+
| `xebis.ansible.direnv` | direnv and Bash config for direnv | `xebis.ansible.apt` |
1314
| [xebis.ansible.grub](roles/grub/README.md) | GRUB menu configuration. | |
1415
| `xebis.ansible.fail2ban` | Fail2ban IPS | `xebis.ansible.apt` |
1516
| `xebis.ansible.google_chrome` | Google Chrome (Stable) | `xebis.ansible.apt` |

roles/direnv/meta/main.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
dependencies:
3+
- role: xebis.ansible.apt # Expects updated apt cache

roles/direnv/tasks/main.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: Install direnv
3+
become: true
4+
ansible.builtin.apt:
5+
name:
6+
- direnv
7+
state: present
8+
9+
- name: Set up Bash to use direnv
10+
ansible.builtin.blockinfile:
11+
path: ~/.bashrc
12+
block: |
13+
eval "$(direnv hook bash)"
14+
marker: "# {mark} direnv configuration"
15+
create: true
16+
mode: u=rw,g=,o=

test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@
4848
name: hetzner-iac-cac
4949
- owner: xebis
5050
name: infra
51+
- role: xebis.ansible.direnv
5152
- role: xebis.ansible.visual_studio_code

0 commit comments

Comments
 (0)