-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansiblecommands
273 lines (273 loc) · 9.3 KB
/
ansiblecommands
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
1 cat /.ssh/authorized_keys
2 cd .ssh/authorized_keys
3 cat .ssh/authorized_keys
4 ssh-add ~/.ssh/id_rsa
5 ssh-keygen
6 cd .ssh/
7 ll
8 vim id_rsa
9 vim id_rsa.pub
10 ssh-copy-id [email protected]
11 ssh-copy-id [email protected]
12 cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
13 ssh [email protected]
14 cd
15 cd /home/ubuntu/
16 ll
17 ssh -i Letschalktalk.pem [email protected]
18 chmod 700 .ssh
19 chmod 600 .ssh/authorized_keys
20 chmod 400 Letschalktalk.pem
21 restorecon -r -vv .ssh/authorized_keys
22 chmod 400 Letschalktalk.pem
23 ssh -i Letschalktalk.pem [email protected]
24 ssh [email protected]
25 cd
26 ssh [email protected]
27 su aakash
28 cd
29 apt-get update
30 apt-get install software-properties-common
31 apt-get install ansible
32 cd /etc/ansible/
33 ll
34 cat ansible.cfg
35 ansible
36 cd
37 ansible -v
38 cd /etc/ansible/
39 l
40 ll
41 vim hosts
42 ssh-agent bash
43 vim /etc/ssh/sshd_config
44 adduser aakash
45 /etc/init.d/ssh restart
46 ll
47 cd /home/ubuntu/
48 ll
49 ssh -i Letschalktalk.pem [email protected]
50 ssh -i Letschalktalk.pem [email protected]
51 ll
52 cd
53 ssh -i /home/ubuntu/Letschalktalk.pem [email protected]
54 ssh-copy-id -i /home/ubuntu/Letschalktalk.pem [email protected]
55 ssh-keygen
56 ssh-copy-id [email protected]
57 cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
58 cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
59 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
60 ssh [email protected]
61 ansible all -m ping
62 vim /etc/ansible/hosts
63 ansible all -m ping
64 ping 172.16.24.6
65 ansible all -m ping
66 ssh [email protected]
67 ansible all -m ping
68 ansible all -m shell -a id
69 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
70 vim /etc/ansible/hosts
71 ansible all -m ping
72 ansible all -m ping -u ubuntu
73 vim /etc/ansible/hosts
74 ansible all -m ping -u ubuntu
75 ansible -v
76 ansible version
77 ansible all -m uptime
78 git pull --rebase
79 apt-get install git
80 git pull --rebase
81 ansible all -m uptime
82 ansible all -m shell -a "uptime"
83 ansible all -m shell -a "top"
84 ansible all -m shell -a "uptime"
85 ansible all -m shell -a id
86 vim first.yml
87 ansible-playbook first.yml
88 apt install rpm
89 rpm -ql ans
90 rpm -ql ansible
91 exit
92 vim aakash.yml
93 ansible-playbook aakash.yml --syntax-check
94 vim aakash.yml
95 ansible-playbook aakash.yml --syntax-check
96 vim aakash.yml
97 ansible-playbook aakash.yml --syntax-check
98 vim /etc/ansible/hosts
99 ansible-playbook aakash.yml --syntax-check
100 vim /etc/ansible/hosts
101 history
102 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"orized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/author
103 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"orized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/author
104 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"orized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/author
105 ssh [email protected]
106 ssh -i /home/ubuntu/Letschalktalk.pem [email protected]
107 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"orized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/author
108 history
109 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
110 ssh [email protected]
111 ansible all -m shell -a "uptime"
112 vim /etc/ansible/hosts
113 ansible all -m shell -a "uptime"
114 history | grep ansible
115 ansible all -m ping
116 ansible-playbook first.yml
117 ansible-playbook aakash.yml
118 ssh [email protected]
119 ansible-playbook aakash.yml
120 ansible-playbook aakash.yml --limit @/root/aakash.retry
121 ssh [email protected]
122 history
123 ansible-playbook aakash.yml -u root
124 ssh [email protected]
125 ansible-playbook aakash.yml
126 cat ~/.ssh/id_rsa.pub | ssh -i /home/ubuntu/Letschalktalk.pem [email protected] " sudo su - && mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"orized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/author
127 vim aakash.yml
128 ansible-playbook aakash.yml
129 ssh [email protected]
130 vim aakash.
131 vim aakash.yml
132 ansible-playbook aakash.yml
133 ansible-doc -l | more
134 ansible-help state
135 ansible-doc state
136 ansible-doc apt
137 ansible-playbook aakash.yml --list-hosts
138 rpm -ql ansible
139 vim /etc/ansible/ansible.cfg
140 hostnamectl set-hostname ansible
141 ansible all -m shell -a "uptime"
142 vim /etc/ansible/ansible.cfg '
143 vim /etc/ansible/ansible.cfg
144 ansible all -m shell -a "uptime"
145 cp -rf /etc/ansible/ansible.cfg /root
146 cd /root/
147 ll
148 vim ansible.cfg
149 cp -rf /etc/ansible/hosts /root
150 vim .ssh/test
151 mkdir aaksh
152 cd aaksh/
153 ll
154 cp /etc/ansible/hosts aaksh
155 ll
156 vim aaksh
157 pwd
158 vim /root/aaksh/aaksh
159 ll
160 cd /etc/ansible/
161 ll
162 rm -rf ansible.cfg hosts
163 ll
164 vim /root/aaksh/aaksh
165 vim /root/ansible.cfg
166 vim /root/ansible.cfg
167 export ANSIBLE_CONFIG=/root/ansible.cfg
168 ansible all -m shell -a uptime -v
169 cp /root/ansible.cfg /hello/hello
170 mkdir hello/hello
171 mkdir hello
172 cd hello/
173 ll
174 cd ..
175 ll
176 rm -rf hello/
177 ll
178 cd
179 mkdir /hello
180 cd /hello/
181 ll
182 mkdir 1234
183 cd 1234/
184 ll
185 pwd
186 cp /root/ansible.cfg /hello/1234
187 vim /hello/1234/ansible.cfg
188 export ANSIBLE_CONFIG=/hello/1234/ansible.cfg
189 ansible all -m shell -a uptime -v
190 echo $ANSIBLE_CONFIG
191 exit
192 cd /etc/ansible/roles/apache/tasks/
193 ll
194 vim install.yml
195 vim configure.yml
196 vim service.yml
197 ll
198 vim /root/aakash.yml
199 ansible-playbook /root/aakash.yml
200 cd ..
201 ll
202 cd files/
203 ll
204 vim index.html
205 cp -rf /root/helloworld hello
206 ll
207 cd ..
208 ll
209 cat tasks/install.yml
210 vim handlers/main.yml
211 cat handlers/main.yml
212 ll
213 cd meta/
214 ll
215 vim main.yml
216 tree
217 cd..
218 cd ..
219 tree
220 cd ..
221 vim helloworld.yml
222 ll
223 vim ansible.cfg
224 vim hosts
225 vim helloworld.yml
226 ansible-playbook helloworld.yml --syntex-check
227 ansible-playbook helloworld.yml --syntax-check
228 vim /etc/ansible/roles/apache/tasks/configure.yml
229 ansible-playbook helloworld.yml --syntax-check
230 ansible-playbook helloworld.yml
231 history
232 ll
233 vim /root/aakash.yml
234 vim helloworld.
235 vim helloworld.yml
236 ansible-playbook helloworld.yml
237 cd roles/apache/
238 ll
239 vim tasks/configure.yml
240 ansible-playbook helloworld.yml
241 cd ..
242 ansible-playbook helloworld.yml
243 cd
244 man ansible-vault
245 cd /etc/ansible/
246 ll
247 vim user.yml
248 ansible-playbook user.yml --syntax-check
249 ansible-vault encrypt user.yml
250 cat user.yml
251 vim user.yml
252 ansible-vault view user.yml
253 mane ansible-vault
254 man ansible.cfg
255 ansible-vault edit user.yml
256 ansible-playbook user.yml
257 ansible-playbook user.yml --ask-vault-pass
258 vim user.
259 vim user.yml
260 ansible-vault edit user.
261 ansible-vault edit user.yml
262 ansible-playbook user.yml --ask-vault-pass
263 ll
264 vim /root/wow
265 ansible-playbook user.yml --vault-password-file /root/wow
266 ansible-vault rekey user.yml
267 ansible-playbook user.yml --ask-vault-pass
268 ansible-vault decrypt user.yml
269 vim user..y
270 cat user.yml
271 cd
272 history
273 history > ansiblecommands