chore: ansible-lint

This commit is contained in:
Clément Désiles
2025-11-02 21:18:15 +01:00
parent 2c6da106b2
commit 2c421611ae
53 changed files with 390 additions and 350 deletions
+1
View File
@@ -1,3 +1,4 @@
---
zsh_home: "{{ '/root' if zsh_user == 'root' else '/home/' + zsh_user }}"
zsh_base_config: "{{ zsh_home }}/.zshrc"
zsh_config_path: "{{ zsh_home }}/.config/zsh"
+6 -7
View File
@@ -1,14 +1,13 @@
---
- name: install zsh
package:
- name: Install zsh
ansible.builtin.package:
name: zsh
state: present
- name: install zsh plugins
include_tasks: plugins.yml
- name: setup zsh for the user(s)
include_tasks: user-setup.yml
- name: Install zsh plugins
ansible.builtin.include_tasks: plugins.yml
- name: Setup zsh for the user(s)
ansible.builtin.include_tasks: user-setup.yml
vars:
zsh_user: "{{ item }}"
loop: "{{ zsh_users | default([]) }}"
+9 -18
View File
@@ -1,5 +1,5 @@
---
- name: ensure plugins directory exists
- name: Ensure plugins directory exists
ansible.builtin.file:
path: "{{ zsh_plugins_path }}"
state: directory
@@ -7,7 +7,7 @@
group: users
mode: "0755"
- name: add a readme file to advice from where this comes
- name: Add a readme file to advice from where this comes
ansible.builtin.copy:
dest: "{{ zsh_plugins_path }}/README.md"
content: |
@@ -17,27 +17,18 @@
group: users
owner: root
- name: "git clone plugins"
git:
- name: "Git clone plugins"
ansible.builtin.git:
repo: "{{ item.repo }}"
dest: "{{ item.dest }}"
update: yes
update: true
version: master
loop:
- {
repo: https://github.com/zsh-users/zsh-syntax-highlighting.git,
dest: "{{ zsh_plugins_path }}/zsh-syntax-highlighting",
}
- {
repo: https://github.com/zsh-users/zsh-autosuggestions.git,
dest: "{{ zsh_plugins_path }}/zsh-autosuggestions",
}
- {
repo: https://github.com/romkatv/powerlevel10k.git,
dest: "{{ zsh_plugins_path }}/powerlevel10k",
}
- { repo: https://github.com/zsh-users/zsh-syntax-highlighting.git, dest: "{{ zsh_plugins_path }}/zsh-syntax-highlighting" }
- { repo: https://github.com/zsh-users/zsh-autosuggestions.git, dest: "{{ zsh_plugins_path }}/zsh-autosuggestions" }
- { repo: https://github.com/romkatv/powerlevel10k.git, dest: "{{ zsh_plugins_path }}/powerlevel10k" }
- name: assert plugins are available for any user
- name: Assert plugins are available for any user
ansible.builtin.file:
path: "{{ item }}"
owner: root
+8 -7
View File
@@ -1,4 +1,5 @@
- name: setup zsh base config
---
- name: Setup zsh base config
ansible.builtin.template:
src: main.zshrc.j2
dest: "{{ zsh_base_config }}"
@@ -6,7 +7,7 @@
group: "{{ zsh_user }}"
mode: "0600"
- name: setup .config/zsh directory
- name: Setup .config/zsh directory
ansible.builtin.file:
path: "{{ zsh_config_path }}"
state: directory
@@ -14,7 +15,7 @@
group: "{{ zsh_user }}"
mode: "0700"
- name: configure zsh config
- name: Configure zsh config
ansible.builtin.template:
src: zshrc.j2
dest: "{{ zsh_config_file }}"
@@ -22,7 +23,7 @@
group: "{{ zsh_user }}"
mode: "0600"
- name: copy aliases
- name: Copy aliases
ansible.builtin.copy:
src: ./templates/aliases
dest: "{{ zsh_config_path }}/aliases"
@@ -30,12 +31,12 @@
group: "{{ zsh_user }}"
mode: "0600"
- name: change default shell to zsh
user:
- name: Change default shell to zsh
ansible.builtin.user:
name: "{{ zsh_user }}"
shell: /bin/zsh
- name: configure powerlevel10k theme
- name: Configure powerlevel10k theme
ansible.builtin.copy:
src: "./templates/{{ 'root.p10k.zsh' if zsh_user == 'root' else 'user.p10k.zsh' }}"
dest: "{{ zsh_p10k_theme_config }}"