MLOPS Batch Nov 2023

Day1

Day 2

Step 1 - Create a VMs
		- Laptop
		- AWS
		- Azure
Step 2 - Install Docker
https://www.devopsschool.com/blog/docker-installation-and-configurations/#Docker_install_in_Ubuntu

Step 3 - D

 651  docker ps
  652  docker images
  653  docker pull httpd
  654  clear
  655  ls
  656  docker images
  657  docker create httpd
  658  docker ps -a
  659  docker create httpd
  660  docker ps -a
  661  docker start 727efa0171e8
  662  docker ps -a
  663  docker start 2aa155db6eea
  664  docker ps -a
  665  docker stop 727efa0171e8
  666  docker ps -a
  667  docker start 727efa0171e8
  668  docker ps -a
  669  docker restart 2aa155db6eea
  670  docker ps -a
  671  docker pause 727efa0171e8
  672  docker ps -a
  673  docker unpause 727efa0171e8
  674  docker ps -a
  675  docker kill 727efa0171e8
  676  docker ps -a
  677  dockerrm  727efa0171e8
  678  docker rm  727efa0171e8
  679  docker ps -a
  680  clear
  681  ls
  682  docker ps -a
  683  docker inspect 2aa155db6eea
  684  curl http://172.17.0.3
  685  clear
  686  ls
  687  docker ps -a
  688  docker exec -it 2aa155db6eea /bin/bash

29 Nov 2023 – Ansible 1st Session

What is Ansible?
=====================
	Config mgmt tool
	---------------------
	Server(S) config mgt

	python
	release
		ansible - cmd - free
		tower - GUI paid
		awx - UI - free
	From Redhat

	tool
		save time -- Deployng something in 1000s of server parr
		save cost - 
		imp quality
	Agent lesss

Whats there in server == resources
-----------------------------
file
dir
package
services
user 
groups
cmd
apt
yum
ps
==========================================================
Why Ansible?
	If you want to Configure 100s of server parr - u can use Ansible

Other tools?
	Chef puppet salt cfengine

How it works?

HUMAN ---> Ansible Control Server(ACS) ----> Ansible remote server(ARS) (S)
	

ACS			ARS
=====================================
Linux			ANY 
Ansible			NA
	--------------> Windows (Winrm)
	---------------> Linux (SSH)
Python			Linux - python
			windows - dotnet - ps

Component of Ansible in (ACS)
==================================
Ansible
	Executables	
	Modules - Python code - RUN IN ARS - a code which u want to do in ARS.
		https://docs.ansible.com/ansible/2.9/modules/list_of_all_modules.html
		https://docs.ansible.com/ansible/2.8/modules/modules_by_category.html
	plugins	- Python code - RUN IN ACS -- feature of ansible
	Configfile -- https://github.com/ansible/ansible/blob/stable-2.9/examples/ansible.cfg

Playbook
	Yaml file whcih contains Module which to be run In ARS

Inventory
	a file which has list of IP addre of ARS
						

30 Nov 2023 – Ansible Adhoc Commands

What is Project?
----------------------
Setup a webserver.

Psucode
-----------------
Step 1 - Install webserver	apt
Step 2 - Copy index.html to /var/www/html	copy
Step 3 - Start a  service	service
============================================

ansible localhost -m apt -a"name=apache2 state=latest"
ansible localhost -m copy -a"src=index.html dest=/var/www/html/index.html"
ansible localhost -m service -a"name=apache2 state=started"

inventory
	LIST OF IP ADDRESS oF ARS
	CMD | file | SCRIPT

ansible all -i 172.22.240.232, -m apt -a"name=apache2 state=latest" -u rajesh -k
ansible all -i 172.22.240.232, -m copy -a"src=index.html dest=/var/www/html/index.html" -u ubuntu -k
ansible all -i 172.22.240.232, -m service -a"name=apache2 state=started" -u ubuntu -k

ansible all -i 132.148.28.255,5.6.6.7, -m apt -a"name=apache2 state=latest" -u root -k
ansible all -i 132.148.28.255,,5.6.6.7, -m copy -a"src=index.html dest=/var/www/html/index.html" -u root -k
ansible all -i 132.148.28.255,,5.6.6.7, -m service -a"name=apache2 state=started" -u root -k

ansible all -i 172.22.240.232, -m apt -a"name=apache2 state=latest" -u rajesh -k -b -K
ansible all -i 172.22.240.232, -m copy -a"src=index.html dest=/var/www/html/index.html" -u rajesh -k -b -K
ansible all -i 172.22.240.232, -m service -a"name=apache2 state=started" -u rajesh -k -b -K


inventory

172.22.240.232
172.22.240.233
172.22.240.234


ansible all -i inventory -m apt -a"name=apache2 state=latest" -u rajesh -k -b -K
ansible all -i inventory -m copy -a"src=index.html dest=/var/www/html/index.html" -u rajesh -k -b -K
ansible all -i inventory -m service -a"name=apache2 state=started" -u rajesh -k -b -K


inventory

[web]
172.22.240.232
172.22.240.233
172.22.240.234

[db]
172.22.240.235
172.22.240.236


ansible web -i inventory -m apt -a"name=apache2 state=latest" -u rajesh -k -b -K
ansible web -i inventory -m copy -a"src=index.html dest=/var/www/html/index.html" -u rajesh -k -b -K
ansible web -i inventory -m service -a"name=apache2 state=started" -u rajesh -k -b -K

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x