Compare commits

...

2 commits

Author SHA1 Message Date
Jan Christian Grünhage 2252225223 chore: add .editorconfig 2021-09-04 09:30:58 +02:00
Jan Christian Grünhage 48744bd22f feat(zsh): add initial role 2021-09-04 09:30:36 +02:00
9 changed files with 110 additions and 0 deletions

6
.editorconfig Normal file
View file

@ -0,0 +1,6 @@
root = true
[*.yml]
insert_final_newline = true
indent_style = space
indent_size = 2

14
roles/zsh/README.md Normal file
View file

@ -0,0 +1,14 @@
zsh
=========
Install and configure zsh and antigen
License
-------
[CNPLv7+](https://thufie.lain.haus/NPL.html)
Author Information
------------------
- [Jan Christian Grünhage](https://jcg.re) <jan.christian@gruenhage.xyz>

View file

@ -0,0 +1,20 @@
---
antigen_repo: https://github.com/zsh-users/antigen.git
antigen_version: v2.2.3
antigen_path: /opt/antigen
antigen_plugins:
- zsh-users/zsh-syntax-highlighting
- zsh-users/zsh-autosuggestions
- zsh-users/zsh-completions
antigen_theme: gnzh
zsh_users:
- name: root
home_path: /root
plugins: "{{ antigen_plugins }}"
theme: "{{ antigen_theme }}"
zshrc_extra: "{{ zsh_zshrc_extra }}"
zsh_zshrc_extra: ""

View file

@ -0,0 +1 @@
---

8
roles/zsh/meta/main.yml Normal file
View file

@ -0,0 +1,8 @@
---
galaxy_info:
author: Jan Christian Grünhage
description: Install and configure zsh with antigen
license: CPNLv7+
min_ansible_version: 2.5
galaxy_tags: []
dependencies: []

23
roles/zsh/tasks/main.yml Normal file
View file

@ -0,0 +1,23 @@
---
- name: Install zsh
package:
name:
- git
- zsh
become: yes
- name: Clone antigen
git:
repo: "{{ antigen_repo }}"
dest: "{{ antigen_path }}"
version: "{{ antigen_version }}"
become: yes
- name: Make antigen world readable
file:
path: "{{ antigen_path }}"
state: directory
recurse: true
mode: "a+rX"
become: yes
- name: Template .zshrc
include: user.yml
loop: "{{ zsh_users }}"

22
roles/zsh/tasks/user.yml Normal file
View file

@ -0,0 +1,22 @@
---
- name: Template zshrc
template:
src: .zshrc.j2
dest: "{{ item.home_path }}/.zshrc"
owner: "{{ item.name }}"
group: "{{ item.name }}"
become: yes
- name: Set default shell
user:
name: "{{ item.name }}"
shell: "/bin/zsh"
become: yes
- name: Ensure ~/.profile exists
file:
path: "{{ item.home_path }}/.profile"
state: touch
access_time: preserve
modification_time: preserve
owner: "{{ item.name }}"
group: "{{ item.name }}"
become: yes

View file

@ -0,0 +1,14 @@
source {{ antigen_path }}/bin/antigen.zsh
antigen use oh-my-zsh
antigen bundle <<EOBUNDLES
{% for plugin in item.plugins %}
{{ plugin }}
{% endfor %}
EOBUNDLES
antigen theme {{ item.theme }}
antigen apply
source ~/.profile
{{ item.zshrc_extra }}

2
roles/zsh/vars/main.yml Normal file
View file

@ -0,0 +1,2 @@
---
# vars file for zsh