-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsession-15.txt
212 lines (170 loc) · 4.06 KB
/
session-15.txt
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
disadvantages
--------------
1. no idempotency
2. no error handling
3. Hard to understand
4. Homogeneous --> means only works for one distro
5. not scalable
6. imperative type of programming
configuration management
----------------
server should be ready with application
install application runtime
install system packages
install application dependencies
download the code
create users, permissions, directories
create systemctl services
CM tools --> puppet, chef --> old. Ansible is new
push vs pull
---------------
Delhi --> Hyd
1. asking DTDC office every day --> pull
2. dont do anything, when letter comes DTDC deliver to you --> Push
pull
------
1. internet traffic increases
2. unnecessary bandwidth consumption
3. power and system resources
4. cost
push
-----
active notifications
CRUD --> create, read, update, delete
Adhoc commands
---------------
SSH protocol
ansible -i <inventory> -e ansible_user=ec2-user -e ansible_password=DevOps321
Linux --> Commands = Anible --> modules/collections
ansible -i 172.31.16.150, all -e ansible_user=ec2-user -e ansible_password=DevOps321 -m ping
ansible -i 172.31.16.150, all -e ansible_user=ec2-user -e ansible_password=DevOps321 -m dnf -a "name=nginx state=installed"
-b --> become root
Manually configured servers --> through commands
Shell script --> all commands in a file, run that file one time
Adhoc commands --> manual way
Playbook --> keep all your modules in a single file with YAML syntax. Run that file. it is done
YAML --> Yet another markup language
DTO --> data transfer objects
----------------------------
HTML --> Hyper text markup language
XML --> extensive markup language
<User>
<Username>sivakumar</Username>
<Password>admin123</Password>
</User>
Name
Amount
Date
Amount
Date
forms/templates
XML
-----------
<Student>
<Name>Sivakumar</Name>
<DOB>2020-01-01</DOB>
<Address>Gandhi Nagar, KR Puram, Bengaluru</Address>
</Student>
<Students>
<Student>
<Name>Sivakumar</Name>
<DOB>2020-01-01</DOB>
<Addresses>
<PermAddress>
<AddressLine1>D-203</AddressLine1
<AddressLine2>Sai Apartments</AddressLine2>
<Stree>Gandi Nagar</Street>
</PermAddress>
<CurrentAddress>
<AddressLine1>D-203</AddressLine1
<AddressLine2>Sai Apartments</AddressLine2>
<Stree>Gandi Nagar</Street>
</CurrentAddress>
</Addresses>
</Student>
<Student>
<Name>Sivakumar</Name>
<DOB>2020-01-01</DOB>
<Addresses>
<PermAddress>
<AddressLine1>D-203</AddressLine1
<AddressLine2>Sai Apartments</AddressLine2>
<Stree>Gandi Nagar</Street>
</PermAddress>
<CurrentAddress>
<AddressLine1>D-203</AddressLine1
<AddressLine2>Sai Apartments</AddressLine2>
<Stree>Gandi Nagar</Street>
</CurrentAddress>
</Addresses>
</Student>
</Students>
JSON --> Java script object notation
-----------------------------------
{
"Username": "sivakumar",
"Password": "admin123",
"DoorNo": 123
}
{
"name": "sivakumar",
"dob": "2020-01-01",
"address": "D-203, Gandhi Nagar, Bang"
}
[] --> denotes list
{} --> map/dictionary
{
"name": "sivakumar",
"dob": "2020-01-01",
"address": [
{
"addressline-1": "D-203",
"addressline-2": "gandhi nagar",
"city": "bang"
},
{
"addressline-1": "D-203",
"addressline-2": "gandhi nagar",
"city": "bang"
}
]
}
YAML --> Yet another markup language
-------------------------------------
based on indentation
- = list
name: sivakumar
dob: 2020-01-01
name: sivakumar
dob: 2020-01-01
address: d-203, gandhi nagar, bengaluru
name: sivakumar
dob: 2020-01-01
addresses:
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
gender: male
- name: sivakumar
dob: 2020-01-01
addresses:
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
gender: male
- name: sivakumar
dob: 2020-01-01
addresses:
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
- addressline-1: d-203
addressline-2: gandhi nagar
city: bengaluru
gender: male