Ansible ins Repo migrieren und zentrale SSH-Keys in shared/ssh.
Playbooks liegen unter pve1/ansible und pve2/ansible; authorized_keys als Fragmente mit Deploy-Skript und Ziel-Matrix für Proxmox, VM 101 und CTs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
---
|
||||
- name: Install and configure fish shell with bobthefish
|
||||
hosts: servers
|
||||
become: true
|
||||
|
||||
vars:
|
||||
target_user: jean
|
||||
fisher_url: https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish
|
||||
|
||||
tasks:
|
||||
- name: Install fish shell
|
||||
apt:
|
||||
name: fish
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Set fish as default shell for {{ target_user }}
|
||||
user:
|
||||
name: "{{ target_user }}"
|
||||
shell: /usr/bin/fish
|
||||
|
||||
- name: Create fish config directory
|
||||
file:
|
||||
path: /home/{{ target_user }}/.config/fish/functions
|
||||
state: directory
|
||||
owner: "{{ target_user }}"
|
||||
group: "{{ target_user }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Install Fisher plugin manager
|
||||
become_user: "{{ target_user }}"
|
||||
shell: |
|
||||
curl -sL {{ fisher_url }} | source && fisher install jorgebucaran/fisher
|
||||
args:
|
||||
executable: /usr/bin/fish
|
||||
creates: /home/{{ target_user }}/.config/fish/functions/fisher.fish
|
||||
|
||||
- name: Install bobthefish theme
|
||||
become_user: "{{ target_user }}"
|
||||
shell: |
|
||||
fisher install oh-my-fish/theme-bobthefish
|
||||
args:
|
||||
executable: /usr/bin/fish
|
||||
register: bobthefish_install
|
||||
changed_when: "'Installing' in bobthefish_install.stdout"
|
||||
|
||||
- name: Configure bobthefish in config.fish
|
||||
become_user: "{{ target_user }}"
|
||||
blockinfile:
|
||||
path: /home/{{ target_user }}/.config/fish/config.fish
|
||||
create: true
|
||||
owner: "{{ target_user }}"
|
||||
group: "{{ target_user }}"
|
||||
mode: "0644"
|
||||
marker: "# {mark} ANSIBLE MANAGED - bobthefish config"
|
||||
block: |
|
||||
set -g theme_color_scheme nord
|
||||
set -g theme_display_git yes
|
||||
set -g theme_display_git_dirty yes
|
||||
set -g theme_display_git_untracked yes
|
||||
set -g theme_git_worktree_support no
|
||||
set -g theme_display_vagrant no
|
||||
set -g theme_display_docker_machine no
|
||||
set -g theme_display_k8s_context no
|
||||
set -g theme_display_user ssh
|
||||
set -g theme_display_hostname ssh
|
||||
set -g theme_show_exit_status yes
|
||||
set -g theme_title_use_abbreviated_path yes
|
||||
set -g fish_greeting ""
|
||||
|
||||
- name: Install Nerd Font (JetBrainsMono) for powerline glyphs
|
||||
block:
|
||||
- name: Create fonts directory
|
||||
file:
|
||||
path: /home/{{ target_user }}/.local/share/fonts
|
||||
state: directory
|
||||
owner: "{{ target_user }}"
|
||||
group: "{{ target_user }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Download JetBrainsMono Nerd Font
|
||||
become_user: "{{ target_user }}"
|
||||
get_url:
|
||||
url: https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip
|
||||
dest: /tmp/JetBrainsMono.zip
|
||||
timeout: 60
|
||||
|
||||
- name: Install unzip
|
||||
apt:
|
||||
name: unzip
|
||||
state: present
|
||||
|
||||
- name: Unzip Nerd Font
|
||||
become_user: "{{ target_user }}"
|
||||
unarchive:
|
||||
src: /tmp/JetBrainsMono.zip
|
||||
dest: /home/{{ target_user }}/.local/share/fonts/
|
||||
remote_src: true
|
||||
creates: /home/{{ target_user }}/.local/share/fonts/JetBrainsMonoNerdFont-Regular.ttf
|
||||
|
||||
- name: Install fontconfig
|
||||
apt:
|
||||
name: fontconfig
|
||||
state: present
|
||||
|
||||
- name: Rebuild font cache
|
||||
become_user: "{{ target_user }}"
|
||||
command: fc-cache -f
|
||||
changed_when: true
|
||||
Reference in New Issue
Block a user