Skip to content

Commit

Permalink
Add role: i3
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 7, 2018
1 parent 7223a72 commit 49d34ad
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ This is a base idempotent provisioning with sensible defaults that can be slight
<td><a href="https://www.hipchat.com/downloads">hipchat</a></td>
<td>HipChat repo and package</td>
</tr>
<tr>
<td><a href="https://github.com/i3/i3">i3</a></td>
<td>i3wm</td>
</tr>
<tr>
<td><a href="https://github.com/Airblader/i3">i3-gaps</a></td>
<td>i3wm on steroids</td>
Expand Down
4 changes: 4 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
roles: [i3-utils-bin]
tags: i3-utils-bin

- hosts: all
roles: [i3]
tags: i3

- hosts: all
roles: [i3-gaps]
tags: i3-gaps
Expand Down
4 changes: 4 additions & 0 deletions roles/i3/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---

# 'install', 'remove' or 'ignore'
i3: 'ignore'
7 changes: 7 additions & 0 deletions roles/i3/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- name: ensure i3-wm is installed
include_role:
name: apt-meta
vars:
apt_packages: "{{ [i3_package_name] + i3_shared_packages }}"
7 changes: 7 additions & 0 deletions roles/i3/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- include_tasks: install.yml
when: i3 == 'install'

- include_tasks: uninstall.yml
when: i3 == 'remove'
8 changes: 8 additions & 0 deletions roles/i3/tasks/uninstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- name: ensure i3-wm is removed
include_role:
name: apt-meta
vars:
apt_state: absent
apt_packages: "{{ i3_package_name }}"
9 changes: 9 additions & 0 deletions roles/i3/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

i3_package_name: i3-wm

i3_shared_packages:
- i3blocks
- i3lock
- i3status
- suckless-tools

0 comments on commit 49d34ad

Please sign in to comment.