-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsession-36.txt
40 lines (33 loc) · 1.03 KB
/
session-36.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
Backend
--------------------
1. create EC2 instance first
2. connect to the server using null resource and remote exec.
3. copy the script into instance.
4. run ansible configuration
5. stop the server
6. take AMI
7. delete the server
aws configure
aws
8. target group creation
9. launch template
10. autoscaling and policy
11. listener rule
match the declared configuration with actual configuration
actual configuration of server
server state --> terminated
declared state --> create the server
userdata
---------------------
once ec2 instance created, aws will run userdata script.
1. we have to login inside instance and check the logs,
2. once userdata is changed, AWS will not update EC2
delete EC2 manually and run terrafrom again
remote provisoner
---------------------
execute the scripts in remote servers
ansible-playbook -i <inventory> <yaml-name> -e var=value --> ansible server
ansible pull
--------------
install ansible in remote node
ansible-pull -i <inventory> <ansible-playbook-git-url> <yaml-name> -e var=value --> remote node