-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
827dd4a
commit ff8cbae
Showing
2 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
Ansible | ||
------------------- | ||
shell disadvantages | ||
|
||
1. shell script will not work in all linux distros. | ||
2. scalability --> difficult to manage more no of servers | ||
3. error handling and validations, need to manual | ||
4. readability | ||
5. shell will only work for linux, will not work with external systems | ||
|
||
Configuration management | ||
------------------- | ||
configure your laptop | ||
to make server ready for application deployment is called configuring server | ||
|
||
deployment | ||
------------ | ||
1. stop the server | ||
2. remove old code | ||
3. download new code | ||
4. restart server | ||
|
||
|
||
Idempotence --> | ||
|
||
if you run a program multiple time, that can create samething multiple times | ||
even you run your program infinite times, it should not create any damage | ||
|
||
providing same result irrespective of no.of executions is called idempotence | ||
|
||
|
||
useradd ramesh | ||
1. it will create multiple ramesh users --> bad | ||
2. it will try to create user, but got error and program exit --> no | ||
|
||
ansible --> if not exist it will create, if exist it will ignore --> yes | ||
|
||
|
||
Delhi --> Hyderabad --> today | ||
|
||
Delhi --> HYD DTDC | ||
|
||
You going to HYD DTDC everyday and ask for courier | ||
2nd day | ||
3rd day | ||
4th day | ||
5th day --> got courier | ||
|
||
HYD DTDC --> deliver to home | ||
|
||
traffic increases | ||
fuel consumption | ||
resources waste | ||
time waste | ||
|
||
pull based configure | ||
------------------- | ||
chef server | ||
|
||
we will configure agents to check every 1 hour | ||
|
||
24*7 = 168 time connect to server | ||
bandwidth waste | ||
resources consumption like CPU and memory | ||
|
||
pull configuration have one advantage --> at the end of ansible | ||
|
||
Linux --> everything is called as command | ||
ansible --> module/collection | ||
|
||
one by one module --> success/fail | ||
|
||
keep all modules/commands in a file | ||
keep some validations, conditions, loops, variables | ||
now run the file | ||
|
||
Playbook --> a file of modules/collections | ||
YAML --> yet another markup language | ||
|
||
|
||
deposit form/ withdrawal form | ||
----------------------------- | ||
|
||
NAME | ||
A/C | ||
DATE | ||
BRANCH | ||
AMOUNT | ||
|
||
AMOUNT | ||
NAME | ||
A/C | ||
BRANCH | ||
|
||
NAME | ||
A/C | ||
DATE | ||
BRANCH | ||
AMOUNT | ||
|
||
DTO --> data transfer object | ||
---------------------------- | ||
XML --> Extensive Markup Language | ||
|
||
<User> | ||
<Email>[email protected]</Email> | ||
<Password>admin123</Password> | ||
</User> | ||
|
||
JSON --> Java script object notation | ||
---------------------------- | ||
|
||
{ | ||
"Emai": "[email protected]", | ||
"Password":"admin123" | ||
} | ||
|
||
YAML | ||
---------------------------- | ||
email: "[email protected]" | ||
password: "admin123" | ||
|
||
|
||
address_____________ | ||
|
||
addressline1 | ||
addressline2 | ||
street | ||
city | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variables | ||
-------------------- | ||
DRY --> dont repeat yourself | ||
|
||
variables we keep aside from the code, so that code will not be disturbed when we are doing changes. | ||
|
||
variable holds a value, you can use it anywhere | ||
|
||
data types | ||
------------------- | ||
list | ||
map | ||
boolean | ||
key, value | ||
|
||
conditions | ||
----------------- | ||
id roboshop | ||
if not exist we created, if exist we skipped | ||
|
||
SOME_VAR=$(command) |