Skip to content

Commit 7410f09

Browse files
committed
feat: install zsh and tune vps terminal
1 parent 8b46fac commit 7410f09

File tree

1 file changed

+102
-2
lines changed

1 file changed

+102
-2
lines changed

ansible/playbook.yaml

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
tasks:
2525
- name: Update and install packages
2626
apt:
27-
name: [ 'apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common' , 'python3-pip', 'virtualenv', 'python3-setuptools']
27+
name: [ 'apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common' , 'python3-pip', 'virtualenv', 'python3-setuptools', 'zsh']
2828
state: present
2929
update_cache: yes
3030

@@ -54,11 +54,111 @@
5454
pip:
5555
name: docker
5656

57-
- name: Download docker for pentest image
57+
- name: Download Offensive Docker image
5858
docker_image:
5959
name: "{{ docker_image }}"
6060
source: pull
6161

62+
- name: Change default shell to zsh
63+
user:
64+
name: "{{ username }}"
65+
shell: /bin/zsh
66+
67+
- name: Set TERM environment variable
68+
lineinfile:
69+
dest: /etc/environment
70+
line: 'TERM=xterm-256color'
71+
72+
- name: Clone oh-my-tmux repository
73+
git:
74+
repo: 'https://github.com/gpakosz/.tmux.git'
75+
dest: /home/offensive/.tmux
76+
depth: '1'
77+
force: yes
78+
79+
- name: Clone oh-my-zsh repository
80+
git:
81+
repo: 'https://github.com/ohmyzsh/ohmyzsh.git'
82+
dest: /home/offensive/.oh-my-zsh
83+
depth: '1'
84+
force: yes
85+
86+
- name: Create a symbolic link for install oh-my-tmux
87+
file:
88+
src: /home/offensive/.tmux/.tmux.conf
89+
dest: /home/offensive/.tmux.conf
90+
owner: "{{ username }}"
91+
group: "{{ username }}"
92+
state: link
93+
force: yes
94+
95+
- name: Copy oh-my-zsh configuration file to .zshrc
96+
copy:
97+
src: /home/offensive/.tmux/.tmux.conf.local
98+
dest: /home/offensive/
99+
remote_src: yes
100+
owner: "{{ username }}"
101+
mode: '0644'
102+
103+
- name: Change oh-my-zsh ownership, group and permissions
104+
file:
105+
path: /home/offensive/.oh-my-zsh
106+
state: directory
107+
recurse: yes
108+
owner: "{{ username }}"
109+
group: "{{ username }}"
110+
mode: '0555'
111+
112+
- name: Copy oh-my-zsh configuration file to .zshrc
113+
copy:
114+
src: /home/offensive/.oh-my-zsh/templates/zshrc.zsh-template
115+
dest: /home/offensive/.zshrc
116+
remote_src: yes
117+
owner: "{{ username }}"
118+
mode: '0644'
119+
120+
- name: Download zsh-syntax-highlighting plugin
121+
git:
122+
repo: 'https://github.com/zsh-users/zsh-syntax-highlighting.git'
123+
dest: /home/offensive/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
124+
depth: '1'
125+
force: yes
126+
127+
- name: Download zsh-completions plugin
128+
git:
129+
repo: 'https://github.com/zsh-users/zsh-completions.git'
130+
dest: /home/offensive/.oh-my-zsh/custom/plugins/zsh-completions
131+
depth: '1'
132+
force: yes
133+
134+
- name: Download zsh-history-substring-search plugin
135+
git:
136+
repo: 'https://github.com/zsh-users/zsh-history-substring-search.git'
137+
dest: /home/offensive/.oh-my-zsh/custom/plugins/zsh-history-substring-search
138+
depth: '1'
139+
force: yes
140+
141+
- name: Download zsh-autosuggestions plugin
142+
git:
143+
repo: 'https://github.com/zsh-users/zsh-autosuggestions.git'
144+
dest: /home/offensive/.oh-my-zsh/custom/plugins/zsh-autosuggestions
145+
depth: '1'
146+
force: yes
147+
148+
- name: Enable oh-my-zsh plugins
149+
lineinfile:
150+
path: /home/offensive/.zshrc
151+
regexp: '^plugins=\('
152+
line: plugins=(git docker tmux ubuntu colored-man-pages zsh-syntax-highlighting zsh-completions history-substring-search zsh-autosuggestions)
153+
154+
- name: zsh-completions configuration
155+
lineinfile:
156+
path: /home/offensive/.zshrc
157+
state: present
158+
firstmatch: yes
159+
insertafter: '^plugins=\('
160+
line: autoload -U compinit && compinit
161+
62162
- name: Configuration finished
63163
debug:
64164
msg: System configured correctly.

0 commit comments

Comments
 (0)