Add shell play book to install zsh and oh-my-zsh.
parent
ccfd2e305c
commit
0cd0af20d4
|
@ -35,5 +35,8 @@
|
|||
- name: Install docker
|
||||
ansible.builtin.import_playbook: src/docker.yml
|
||||
|
||||
- name: Manage Shell
|
||||
ansible.builtin.import_playbook: src/shell.yml
|
||||
|
||||
- name: Run sudo without password
|
||||
ansible.builtin.import_playbook: src/sudonopass.yml
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
- name: Maintain Shell configuration
|
||||
hosts: linux
|
||||
become: true
|
||||
become_user: sunrui
|
||||
vars:
|
||||
user: "sunrui"
|
||||
|
||||
tasks:
|
||||
- name: Zsh
|
||||
apt:
|
||||
name: zsh
|
||||
state: present
|
||||
- name: Set zsh as default shell
|
||||
become: true
|
||||
user:
|
||||
name: "{{ user }}"
|
||||
shell: /usr/bin/zsh
|
||||
- name: Install oh-my-zsh
|
||||
become: true
|
||||
git:
|
||||
repo: https://github.com/ohmyzsh/ohmyzsh.git
|
||||
dest: /home/{{ user }}/.oh-my-zsh
|
||||
clone: true
|
||||
force: true
|
||||
- name: Install zsh-autosuggestions plugin
|
||||
become: true
|
||||
git:
|
||||
repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
||||
dest: /home/{{ user }}/.oh-my-zsh/custom/plugins/zsh-autosuggestions
|
||||
clone: true
|
||||
force: true
|
||||
register: autosuggestions
|
||||
|
||||
- name: Configure zsh-autosuggestions plugin
|
||||
become: true
|
||||
lineinfile:
|
||||
path: /home/{{ user }}/.zshrc
|
||||
regexp: '^plugins='
|
||||
line: 'plugins=(git zsh-autosuggestions)'
|
||||
when: autosuggestions.changed
|
Loading…
Reference in New Issue