Add a zsh role for Debian and macOS
This commit is contained in:
		
							parent
							
								
									8149f5b499
								
							
						
					
					
						commit
						bd0e0d9b3e
					
				| @ -1,6 +1,7 @@ | |||||||
| --- | --- | ||||||
| - hosts: localhost | - hosts: localhost | ||||||
|   roles: |   roles: | ||||||
|  |     - zsh | ||||||
|     - neovim |     - neovim | ||||||
| 
 | 
 | ||||||
| - hosts: windows | - hosts: windows | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								roles/zsh/handlers/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								roles/zsh/handlers/main.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | --- | ||||||
|  | - name: install fzf binaries | ||||||
|  |   command: | ||||||
|  |     cmd: ~/.config/zsh/fzf/install --bin | ||||||
							
								
								
									
										6
									
								
								roles/zsh/tasks/Darwin.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								roles/zsh/tasks/Darwin.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | |||||||
|  | --- | ||||||
|  | - name: install homebrew packages | ||||||
|  |   homebrew: | ||||||
|  |     name: | ||||||
|  |       - zsh | ||||||
|  |     state: latest | ||||||
							
								
								
									
										10
									
								
								roles/zsh/tasks/Debian.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								roles/zsh/tasks/Debian.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | |||||||
|  | --- | ||||||
|  | - name: install apt packages | ||||||
|  |   become: true | ||||||
|  |   apt: | ||||||
|  |     name: | ||||||
|  |       - zsh | ||||||
|  |       - zsh-doc | ||||||
|  |       - pinentry-curses | ||||||
|  |       - unzip | ||||||
|  |     state: latest | ||||||
							
								
								
									
										83
									
								
								roles/zsh/tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								roles/zsh/tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,83 @@ | |||||||
|  | --- | ||||||
|  | - include_tasks: '{{ansible_os_family}}.yaml' | ||||||
|  | 
 | ||||||
|  | - name: clone config repo | ||||||
|  |   git: | ||||||
|  |     repo: git@code.infektor.net:config/zsh.git | ||||||
|  |     dest: ~/.config/zsh | ||||||
|  |     version: master | ||||||
|  | 
 | ||||||
|  | - name: clone plugin repos | ||||||
|  |   git: | ||||||
|  |     repo: '{{item.repo}}' | ||||||
|  |     dest: '{{item.dest}}' | ||||||
|  |   with_items: | ||||||
|  |     - repo: https://github.com/zsh-users/zsh-autosuggestions.git | ||||||
|  |       dest: ~/.config/zsh/zsh-autosuggestions | ||||||
|  |     - repo: https://github.com/zsh-users/zsh-history-substring-search.git | ||||||
|  |       dest: ~/.config/zsh/zsh-history-substring-search | ||||||
|  |     - repo: https://github.com/zsh-users/zsh-syntax-highlighting.git | ||||||
|  |       dest: ~/.config/zsh/zsh-syntax-highlighting | ||||||
|  |     - repo: https://github.com/zsh-users/zsh-completions.git | ||||||
|  |       dest: ~/.config/zsh/zsh-completions | ||||||
|  | 
 | ||||||
|  | - name: clone fzf repo | ||||||
|  |   git: | ||||||
|  |     repo: https://github.com/junegunn/fzf.git | ||||||
|  |     dest: ~/.config/zsh/fzf | ||||||
|  |   notify: install fzf binaries | ||||||
|  | - meta: flush_handlers | ||||||
|  | 
 | ||||||
|  | - name: create directories | ||||||
|  |   file: | ||||||
|  |     state: directory | ||||||
|  |     dest: '{{item}}' | ||||||
|  |   with_items: | ||||||
|  |     - ~/.local/bin | ||||||
|  |     - ~/.local/share/zsh/site-functions | ||||||
|  | 
 | ||||||
|  | - name: create symbolic links | ||||||
|  |   file: | ||||||
|  |     state: link | ||||||
|  |     src: '{{item.src}}' | ||||||
|  |     dest: '{{item.dest}}' | ||||||
|  |   with_items: | ||||||
|  |     - src: ~/.config/zsh/zlogin | ||||||
|  |       dest: ~/.zlogin | ||||||
|  |     - src: ~/.config/zsh/zlogout | ||||||
|  |       dest: ~/.zlogout | ||||||
|  |     - src: ~/.config/zsh/zprofile | ||||||
|  |       dest: ~/.zprofile | ||||||
|  |     - src: ~/.config/zsh/zshenv | ||||||
|  |       dest: ~/.zshenv | ||||||
|  |     - src: ~/.config/zsh/zshrc | ||||||
|  |       dest: ~/.zshrc | ||||||
|  |     - src: ~/.config/zsh/prompt_fresh_setup | ||||||
|  |       dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup | ||||||
|  |     - src: ~/.config/zsh/build/_build-dir | ||||||
|  |       dest: ~/.local/share/zsh/site-functions/_build-dir | ||||||
|  |     - src: ~/.config/zsh/sandbox/_sandbox | ||||||
|  |       dest: ~/.local/share/zsh/site-functions/_sandbox | ||||||
|  |     - src: ~/.config/zsh/layout/_layout | ||||||
|  |       dest: ~/.local/share/zsh/site-functions/_layout | ||||||
|  |     - src: ~/.config/zsh/notes/_note | ||||||
|  |       dest: ~/.local/share/zsh/site-functions/_note | ||||||
|  |     - src: ~/.config/zsh/fzf/bin/fzf | ||||||
|  |       dest: ~/.local/bin/fzf | ||||||
|  |     - src: ~/.config/zsh/fzf/bin/fzf-tmux | ||||||
|  |       dest: ~/.local/bin/fzf-tmux | ||||||
|  |     - src: ~/.config/zsh/cmake-uninstall | ||||||
|  |       dest: ~/.local/bin/cmake-uninstall | ||||||
|  |     - src: ~/.config/zsh/$ | ||||||
|  |       dest: ~/.local/bin/$ | ||||||
|  | 
 | ||||||
|  | - name: get absolute path | ||||||
|  |   shell: command -v zsh | ||||||
|  |   register: zsh | ||||||
|  |   changed_when: false | ||||||
|  | 
 | ||||||
|  | - name: set default shell | ||||||
|  |   user: | ||||||
|  |     name: '{{lookup("env", "USER")}}' | ||||||
|  |     shell: '{{zsh.stdout}}' | ||||||
|  |   become: true | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user