-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yaml
156 lines (131 loc) · 4.44 KB
/
playbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
- name: "prepare env"
hosts: localhost
connection: local
become: yes
tasks:
- name: Install i3 user repo
ansible.builtin.get_url:
url: https://packages.test.osinfra.cn/coprs/mywaaagh_admin/i3wm/repo/openeuler-{{ansible_distribution_version}}/mywaaagh_admin-i3wm-openeuler-{{ansible_distribution_version}}.repo
dest: /etc/yum.repos.d/i3wm.repo
mode: '0644'
when: ansible_facts['distribution'] == "openEuler"
- name: "save real name"
hosts: localhost
connection: local
tasks:
- name: "save real name"
ansible.builtin.shell:
cmd: whoami
register: real_name
- name: "Custom a waaagh workspace"
hosts: localhost
connection: local
become: yes
tasks:
- name: Install the latest version of my favorite packages
ansible.builtin.package:
state: latest
name:
- git
- python-pip
- vim
- fish
- name: Set default shell to fish
ansible.builtin.user:
name: "{{ real_name.stdout }}"
shell: /usr/bin/fish
- name: "save fish version"
ansible.builtin.shell:
cmd: fish -v | grep -oE '[0-9.]+'
register: fish_versioin
- name: Install my editor
ansible.builtin.package:
state: latest
name:
- neovim
when: ansible_facts['distribution'] != "openEuler"
- name: Install the latest version of package needed by i3wm
ansible.builtin.package:
state: latest
name:
- i3
- i3lock
- i3blocks
- dmenu
- lightdm
- name: Install the latest version of more extra packages
ansible.builtin.package:
state: latest
name:
- xorg-x11-server
- xorg-x11-drv-*
- google-noto-cjk-fonts
when: ansible_facts['distribution'] == "openEuler"
- name: "install good look nerd fonts"
hosts: localhost
connection: local
tasks:
- name: Install the latest version of fontconfig
ansible.builtin.package:
state: latest
name:
- fontconfig
- name: Create a directory if it does not exist
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.local/share/fonts"
state: directory
mode: '0755'
- name: Install Caskaydia mono regular
ansible.builtin.get_url:
url: https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/CascadiaCode/Regular/complete/Caskaydia%20Cove%20Nerd%20Font%20Complete%20Mono%20Regular.otf
dest: "{{ ansible_env.HOME }}/.local/share/fonts"
- name: Install Caskaydia regular
ansible.builtin.get_url:
url: https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/CascadiaCode/Regular/complete/Caskaydia%20Cove%20Nerd%20Font%20Complete%20Regular.otf
dest: "{{ ansible_env.HOME }}/.local/share/fonts"
- name: install fonts
ansible.builtin.shell:
cmd: fc-cache -f -v
- name: "install fisher and tide"
hosts: localhost
connection: local
tasks:
- name: Install the latest version of fish
ansible.builtin.package:
state: latest
name:
- fish
- name: get fisher scripts
ansible.builtin.get_url:
url: https://git.io/fisher
dest: /tmp/fisher
mode: '0755'
- name: install fisher
ansible.builtin.shell:
cmd: source /tmp/fisher && fisher install jorgebucaran/fisher
executable: /bin/fish
- name: remove fisher scripts
ansible.builtin.file:
path: /tmp/fisher
state: absent
- name: install tide
ansible.builtin.shell:
cmd: fisher install IlanCosman/[email protected]
executable: /bin/fish
when: fish_versioin.stdout is version('3.3.1', '==')
- name: install tide
ansible.builtin.shell:
cmd: fisher install IlanCosman/[email protected]
executable: /bin/fish
when: fish_versioin.stdout is version('3.4.1', '<=') and fish_versioin.stdout is version('3.4.0', '>=')
- name: install tide
ansible.builtin.shell:
cmd: fisher install IlanCosman/[email protected]
executable: /bin/fish
when: fish_versioin.stdout is version('3.5.0', '<=') and fish_versioin.stdout is version('3.5.1', '>=')
- name: install tide
ansible.builtin.shell:
cmd: fisher install IlanCosman/tide@v5
executable: /bin/fish
when: fish_versioin.stdout is version('3.5.1', '>')