DevOps_Basic
DevOps_Basic
TASK 1 ................................................................................................................. 1
DevOps Concepts:.................................................................................................................. 1
a) What is DevOps? How does DevOps Work?.............................................................. 1
b) Describe the DevOps lifecycle. ................................................................................... 2
c) Describe the DevOps Principles. ................................................................................. 3
d) Explain the benefits of DevOps. ................................................................................. 4
TASK 2 ................................................................................................................. 5
TASK 3 ............................................................................................................... 16
TASK 4 ............................................................................................................... 19
TASK 5 ............................................................................................................... 22
TASK 6 ............................................................................................................... 24
DevOps works by breaking down the traditional barriers between development and
operations teams, and by using tools and automation to streamline the software
development process. DevOps teams work to create a culture of collaboration and shared
responsibility, where developers and operations staff work together to build and deploy
software. They use automation tools to automate tasks such as testing, building, and
deploying code, which helps to speed up the development process and reduce errors.
1
b) Describe the DevOps lifecycle.
DevOps lifecycle is a series of automated development processes or workflows within an
iterative development lifecycle. It follows a continuous approach; hence its lifecycle is
symbolized in the form of an infinity loop. This loop depicts the collaborative and iterative
approach throughout the application lifecycle, consisting of tools and technology stacks for
each stage. The left part deals with software development and testing. And in contrast, the
right side of the infinity loop represents the deployment and operations cycle.
1. Plan: In this stage, teams identify the business requirement and collect end-user
feedback. They create a project roadmap to maximize the business value and deliver
the desired product during this stage.
2. Code: The code development takes place at this stage. The development teams use
some tools and plugins like Git to streamline the development process, which helps
them avoid security flaws and lousy coding practices.
3. Build: In this stage, once developers finish their task, they commit the code to the
shared code repository using build tools like Maven and Gradle.
4. Test: Once the build is ready, it is deployed to the test environment first to perform
several types of testing like user acceptance test, security test, integration testing,
performance testing, etc., using tools like JUnit, Selenium, etc., to ensure software
quality.
2
5. Release: The build is ready to deploy on the production environment at this phase.
Once the build passes all tests, the operations team schedules the releases or deploys
multiple releases to production, depending on the organizational needs.
6. Deploy: In this stage, Infrastructure-as-Code helps build the production
environment and then releases the build with the help of different tools.
7. Operate: The release is live now to use by customers. The operations team at this
stage takes care of server configuring and provisioning using tools like Chef.
8. Monitor: In this stage, the DevOps pipeline is monitored based on data collected
from customer behavior, application performance, etc. Monitoring the entire
environment helps teams find the bottlenecks impacting the development and
operations teams’ productivity.
3
d) Explain the benefits of DevOps.
DevOps proponents describe several business and technical benefits, many of which can
result in happier customers. Some benefits of DevOps include:
1. Faster time-to-market: DevOps helps teams deliver software updates more
quickly through automation and collaboration.
2. Higher quality software: DevOps practices catch issues earlier in development,
reducing bugs and defects in production.
3. Improved collaboration and communication: DevOps break down silos and
encourages closer collaboration and communication between teams.
4. Better feedback loops: DevOps promotes continuous monitoring and feedback,
allowing teams to address issues quickly and make improvements based on user
feedback.
5. Increased efficiency: DevOps automates tasks and eliminates wasteful processes,
helping teams work more efficiently.
6. More reliable infrastructure: Treating infrastructure as code allows for version
control and consistent deployment, resulting in more reliable infrastructure.
7. Cost savings: DevOps reduces waste and increases efficiency, leading to cost
savings for organizations.
4
TASK 2
Preparing Lab Environment:
a) Installing VMware Workstation or VirtualBox?
To install VMware Workstation follow the following steps:
Step1: Go to Download VMware Workstation Pro and download workstation 17 pro for
Windows or Linux according to the OS you have.
2. Next
1. Next
5
3. Accept
4. Next 5. Next
7. Check
11. Next
8. Next 10. Check to automatically
add path into system
6
b) Creating Virtual Machine of CentOS 7.
To create the CentOS & virtual machine follow the following steps:
Step1: Open VMware Workstation, and select create a new a Virtual Machine.
7
Step3: Choose I will install the operating system later then Next .
Step4: Choose Linux operating system and CentOS 7 64-bit as version and Next.
Step5: Add name for virtual machine and choose location for VM.
8
Step6: Specify Disk Capacity
9
Step11: Now click power on this virtual machine.
10
Step13: Select Language you like to use and press continue.
Step14:. Configure options Date and time, Language, Keyboard, Network and Hostname.
Step15: Choose the software Software Selection > Server with GUI > Done.
11
Step16: Choose Installation Destination as default and then Done.
Step18: Set password for root and create a user and wait for installation.
12
Step19: After completion of installation Reboot.
Step20: After reboot Accept License agreement > Done and Turn On Network.
Step21:Finish Configuration.
After following all the steps mentioned above our Virtual Machine of CentOS 7 is created
successfully.
13
c) Assign the hostname of Linux machine as <yourname>.devops.com.
d) Configure your network interface with static ip address and start the
network service.
14
e) Map your static ip address to your hosts name in configuration file
/etc/hosts.
15
TASK 3
Linux Fundamentals:
a) Write brief history of Linux.
Linux is a free and open-source operating system created by Linus Torvalds in 1991. It was
made as an alternative to proprietary operating systems like Windows and macOS. Linux
is known for its stability, security, and flexibility, and is widely used in many industries. It
is available in many different versions called distributions, and the Linux community
continues to contribute to its development.
16
17. /opt: Contains optional software packages.
18. /proc: A virtual filesystem that contains system process information.
19. /tmp: A directory for temporary files.
20. /var: Contains variable files, including logs and other data that changes frequently.
21. /run: Contains system runtime data.
c) Login from root user then create folders according to following tree
structure.
17
d) Copy all the files that have .conf filename extensions inside /etc directory
to /root/backup directory.
18
TASK 4
Users, Groups, Permission:
a) Create a user named student.
b) Login from student user then create files and folders according to
following tree structure. [where, d→ directory and f→ file]
19
20
c) Change the permission of the file f1 so that the owner will get full
permission, group member will get read and execute permission and
others will get read-only permissions.
d) Change permission of the file f2 such that the owner’s and group
members will get read and write permission but others will get no
permission.
21
TASK 5
User and Group Administration:
a) Task below are based on following structure.
c) Create user account (user1, user2, user3, user4, user5, user6, manager,
boss) for each employee assigning them respective group.
22
d) Create common directory (production, marketing and sales) for each
department.
e) Change ownership of group directories such that boss will become the
owner and the respective groups will be group owner.
f) Change the permission of the group directories such that only the owner
and group member will get full permission and other will not get any
permission.
23
TASK 6
Package and Service Management, and Firewall Configuration in CentOS7:
a) Enable EPEL repository (epel-release package) and verify the repo
configuration in /etc/yum.repos.d.
24
c) Install httpd package as well as start and enable httpd services.
d) Add the following services and ports to allow packets through the
firewall.[Service = http, smtp port = 25 /tcp, 25/udp, 110/tcp]
e) Remove the following services and ports to block packets through the
firewall.[Service = smtp port = 25 /tcp, 25/udp]
25
TASK 7
Bash Shell Scripting:
a) Write a command to find the path of the bash shell.
c) Write a script named age.sh to prompt for age and display it.
26
d) Write a script named guesspass.sh to guess admin password. [password =
Redhat123]
27
f) Write a script to determine the type of tringle by reading the lengths of
its sides.
28
h) Write a script to print the first 10 elements of Fibonacci series.
29
i) Create a shell script named “bg.sh” inside /root directory which when
execute with parameter ‘boy’, the output should be ‘girl’, when execute
with the parameter ‘girl, the output should be ‘boy’ & when execute with
some other parameter or no parameter the output should be “enter boy
or girl only”]
30