-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline.yaml.bak
136 lines (115 loc) · 3.12 KB
/
line.yaml.bak
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
---
- hosts: all
tasks:
- name: remove comment from enable correction field
lineinfile:
path: ~/.zshrc
regexp: '^# ENABLE_CORRECTION="true"'
line: 'ENABLE_CORRECTION="true"'
- name: enable oh-my-zsh plugins
lineinfile:
path: ~/.zshrc
regexp: '^plugins='
line: 'plugins=(git zsh-autosuggestions zsh-syntax-highlighting)'
- name: comment original theme
lineinfile:
path: ~/.zshrc
regexp: '^ZSH_THEME="robby'
line: '#ZSH_THEME="robbyrussel"'
- name: insert reobin/typenwritten theme
blockinfile:
path: ~/.zshrc
marker: "## {mark} TypenWritten theme ##"
block: |
ZSH_THEME="typewritten/typewritten"
TYPEWRITTEN_PROMPT_LAYOUT="multiline"
TYPEWRITTEN_SYMBOL="->"
TYPEWRITTEN_RELATIVE_PATH="adaptive"
TYPEWRITTEN_CURSOR="block"
insertafter: '^#ZSH_THEME="robby'
- name: insert some aliases
blockinfile:
path: ~/.zshrc
marker: "## {mark} Aliases ##"
block: |
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alhF'
alias ls='ls --color=auto'
insertafter: "^# alias"
- name: insert aliases for apt
blockinfile:
path: ~/.zshrc
marker: "## {mark} Apt aliases ##"
block: |
alias aptu='sudo apt update; sudo apt upgrade -y; sudo apt autopurge -y'
alias apti='sudo apt update; sudo apt install'
alias aptd='sudo apt update; sudo apt autoremove -y'
insertafter: "^## END Aliases"
- hosts: singleuser
become: true
tasks:
- name: copy the .oh-my-zsh to user eddie
copy:
remote_src: yes
src: /home/ansible/.oh-my-zsh
dest: "/home/{{ item.name }}/"
owner: eddie
group: eddie
mode: 0755
loop:
- { name: 'eddie' }
- name: copy the .zshrc file to user eddie
copy:
remote_src: yes
src: /home/ansible/.zshrc
dest: "/home/{{ item.name }}/"
owner: eddie
group: eddie
mode: 0644
loop:
- { name: 'eddie' }
- hosts: multiuser
become: true
tasks:
- name: copy the .oh-my-zsh to users
copy:
remote_src: yes
src: /home/ansible/.oh-my-zsh
dest: "/home/{{ item.name }}/"
owner: "{{ item.name }}"
group: "{{ item.name }}"
mode: 0755
loop: "{{ users }}"
#- { name: 'kathy' }
#- { name: 'eddie' }
- name: copy the .zshrc file to users
copy:
remote_src: yes
src: /home/ansible/.zshrc
dest: "/home/{{ item.name }}/"
owner: "{{ item.name }}"
group: "{{ item.name }}"
mode: 0644
loop:
- { name: 'eddie' }
- { name: 'kathy' }
- hosts: [singleuser]
become: true
tasks:
- name: make zsh the default shell for user eddie
user:
name: "{{ item.name }}"
shell: "{{ item.shell }}"
loop:
- { name: 'eddie', shell: '/usr/bin/zsh' }
- hosts: [multiuser]
become: true
tasks:
- name: make zsh the default shell for users
user:
name: "{{ item.name }}"
shell: "{{ item.shell }}"
loop:
- { name: 'eddie', shell: '/usr/bin/zsh' }
- { name: 'kathy', shell: '/bin/zsh' }