0% found this document useful (0 votes)
9 views55 pages

devops

The document is a record notebook for B.Tech. Information Technology students at Government College of Engineering, detailing practical experiments conducted in the DevOps Laboratory during the academic year 2023-2024. It includes a list of experiments with aims and commands related to Git, GitHub, Maven, and Jenkins. The document serves as a certification of the student's work and is intended for submission for university practical examinations.

Uploaded by

ashwanthramesh31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views55 pages

devops

The document is a record notebook for B.Tech. Information Technology students at Government College of Engineering, detailing practical experiments conducted in the DevOps Laboratory during the academic year 2023-2024. It includes a list of experiments with aims and commands related to Git, GitHub, Maven, and Jenkins. The document serves as a certification of the student's work and is intended for submission for university practical examinations.

Uploaded by

ashwanthramesh31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

GOVERNMENT COLLEGE OF ENGINEERING

ERODE – 638 316

RECORD NOTE BOOK

Register Number:

Certified that this is the bonafide record of work done by Selvan/Selvi

of sixth Semester

B.Tech. Information Technology branch during the academic year 2023-

2024 in the CCS342–Devops Laboratory.

Staff In-charge Head of the Department

Submitted for the university practical examination on


at Government College of Engineering,Erode-638316.

Internal Examiner External Examiner


Ex No Date Name of Experiment Signature

Git-Internals
1

Interaction with GitHub using Git


2 Commands

3 Maven Installation

Gradle Installation and Understanding


Build using Gradle
4

Jenkins Installation and Creation of


freestyle project
5

6 Jenkins Pipeline

Create Maven Build pipeline in Azure


7

8 Create a Maven Build pipeline


in Jenkins

9 Install Ansible and execute


Adhoc commands

10 Installation of VLC media in


windows host
EX NO: 1 Git -Internals
DATE:

AIM:
To learn about basic git commands.
COMMANDS:
sowmya@SOWMYA-11 MINGW64 /d/devops/git (master)
$ git init test
Initialized empty Git repository in D:/devops/git/test/.git/

sowmya@SOWMYA-11 MINGW64 /d/devops/git (master)


$ cd test

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ find .git/objects
.git/objects
.git/objects/info
.git/objects/pack

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ find .git/objects -type f

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'hello world' | git hash-object -w --stdin
3b18e512dba79e4c8300dd08aeb37f8e728b8dad

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ find .git/objects -type f
.git/objects/3b/18e512dba79e4c8300dd08aeb37f8e728b8dad

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
hello world

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'hello world 1' > test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git hash-object -w test.txt
warning: in the working copy of 'test.txt', LF will be replaced by CRLF the next time Git touches it
0a5a3786870ee790b9071e37c30b4a7257e41507

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'hello world 2' > test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git hash-object -w test.txt
warning: in the working copy of 'test.txt', LF will be replaced by CRLF the next time Git touches it
d0e1e95455754bd31d56260d19a7774fd7aebe5d

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ find .git/objects -type f
.git/objects/0a/5a3786870ee790b9071e37c30b4a7257e41507
.git/objects/3b/18e512dba79e4c8300dd08aeb37f8e728b8dad
.git/objects/d0/e1e95455754bd31d56260d19a7774fd7aebe5d
sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)
$ ls
test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ rm test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ ls

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p 0a5a3786870ee790b9071e37c30b4a7257e41507 > test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ ls
test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ cat test.txt
hello world 1

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p 3b18e512dba79e4c8300dd08aeb37f8e728b8dad > test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ cat test.txt
hello world

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -t 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
blob

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git update-index --add --cacheinfo 100644 \3b18e512dba79e4c8300dd08aeb37f8e728b8dad

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git write-tree
c3b8bb102afeca86037d5b5dd89ceeb0090eae9d

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -t c3b8bb102afeca86037d5b5dd89ceeb0090eae9d
tree

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p c3b8bb102afeca86037d5b5dd89ceeb0090eae9d
100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'another helloworld'>new.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git update-index --add --cacheinfo 100644 0a5a3786870ee790b9071e37c30b4a7257e41507

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git update-index --add new.txt
warning: in the working copy of 'new.txt', LF will be replaced by CRLF the next time

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git write-tree
38c7058355f0063bc7f9a5e662e8a195283505a8

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p 38c7058355f0063bc7f9a5e662e8a195283505a8
100644 blob 01cab005b0f4355e61e49571524c13f7ddb7f1eb new.txt
100644 blob 0a5a3786870ee790b9071e37c30b4a7257e41507 test.text
100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git read-tree --prefix=bak c3b8bb102afeca86037d5b5dd89ceeb0090eae9d

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git write-tree
4051b1241b89a1d345f1c2190b28d36092cdabb9

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p 4051b1241b89a1d345f1c2190b28d36092cdabb9
040000 tree c3b8bb102afeca86037d5b5dd89ceeb0090eae9d bak
100644 blob 01cab005b0f4355e61e49571524c13f7ddb7f1eb new.txt
100644 blob 0a5a3786870ee790b9071e37c30b4a7257e41507 test.text
100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad test.txt

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'Commit one' | git commit-tree c3b8bb
d1d95daf2f2331968e676b5b7a6cad20cf17e485

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git cat-file -p d1d95da
tree c3b8bb102afeca86037d5b5dd89ceeb0090eae9d
author Rsowmya26 <[email protected]> 1709568704 +0530
committer Rsowmya26 <[email protected]> 1709568704 +0530

Commit one

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'Commit Two' | git commit-tree 38c705 -p d1d95da
31894013168229eb1a108f39855bf2aff6aacf3b

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ echo 'Commit Three' | git commit-tree 4051b1 -p 3189401
eb71a03930aace42afd679f03577b017efc5dde2

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ git log --stat eb71a0
commit eb71a03930aace42afd679f03577b017efc5dde2
Author: Rsowmya26 <[email protected]>
Date: Mon Mar 4 21:45:18 2024 +0530

Commit Three

bak/test.txt | 1 +
1 file changed, 1 insertion(+)

commit 31894013168229eb1a108f39855bf2aff6aacf3b
Author: Rsowmya26 <[email protected]>
Date: Mon Mar 4 21:44:36 2024 +0530

Commit Two

new.txt | 1 +
test.text | 1 +
2 files changed, 2 insertions(+)

commit d1d95daf2f2331968e676b5b7a6cad20cf17e485
Author: Rsowmya26 <[email protected]>
Date: Mon Mar 4 21:41:44 2024 +0530
Commit one

test.txt | 1 +
1 file changed, 1 insertion(+)

sowmya@SOWMYA-11 MINGW64 /d/devops/git/test (master)


$ find .git/objects -type f
.git/objects/01/cab005b0f4355e61e49571524c13f7ddb7f1eb
.git/objects/0a/5a3786870ee790b9071e37c30b4a7257e41507
.git/objects/31/894013168229eb1a108f39855bf2aff6aacf3b
.git/objects/38/c7058355f0063bc7f9a5e662e8a195283505a8
.git/objects/3b/18e512dba79e4c8300dd08aeb37f8e728b8dad
.git/objects/40/51b1241b89a1d345f1c2190b28d36092cdabb9
.git/objects/c3/b8bb102afeca86037d5b5dd89ceeb0090eae9d
.git/objects/d0/e1e95455754bd31d56260d19a7774fd7aebe5d
.git/objects/d1/d95daf2f2331968e676b5b7a6cad20cf17e485
.git/objects/eb/71a03930aace42afd679f03577b017efc5dde2
RESULT:
Thus the git commands was executed successfully.
EX NO: 2 Interaction with GitHub using Git Commands
DATE:

AIM:
To learn Git commands, facilitating effective version control in projects.
COMMANDS:
1. Clone a Repository:
To copy a repository from GitHub to your local machine:
git clone https://github.com/username/repository.git
2. Add Changes:
To stage changes for the next commit:
git add .
3. Commit Changes:
To save the staged changes to the local repository:
git commit -m “Your commit message”
4. Push Changes to GitHub:
To upload committed changes to your GitHub repository:
git push origin branch-name
5. Pull Changes from GitHub:
To retrieve changes from a GitHub repository to your local repository:
git pull origin branch-name
6. Create a New Branch:
To create a new branch:
git checkout -b new-branch
7. Switch Branches:
To switch between branches:
git checkout branch-name
8. Merge Branches:
To merge changes from one branch into another:
git merge branch-name

9. Fetch Remote Changes:


To fetch changes from the remote repository without merging:
git fetch origin
10. View Remote Repositories:
To see the list of remote repositories:
git remote -v
11. Git Log:
To view a detailed commit history:
git log
RESULT:
Thus, the git commands are explored.
EX NO: 3 Maven Installation
DATE:

AIM:
To install Apache Maven on Windows.
STEPS:
Step 1: Download Maven Zip File and Extract
Click on the Download button.
Now right-click on the downloaded file and click on extract here to extract the file.
Now copy the extracted folder.
Now paste the copy folder in your windows drive in the Program files folder.
Now open the folder apache maven.
Now after opening the folder then copy the address of the folder in program files.

Step 2: Add MAVEN_HOME System Variable


Open the Start menu and search for environment variables.
Click the Edit the system environment variables result.
Under the Advanced tab in the System Properties window, click Environment Variables.
Click the New button under the System variables section to add a new system environment
variable.
Enter MAVEN_HOME as the variable name and the path to the Maven directory as the
variable value. Click OK to save the new system variable.

Step 3: Add MAVEN_HOME Directory in PATH Variable


Select the Path variable under the System variables section in the Environment Variables
window. Click the Edit button to edit the variable.
Click the New button in the Edit environment variable window.
Enter %MAVEN_HOME%\bin in the new field. Click OK to save changes to the Path
variable.
Note: Not adding the path to the Maven home directory to the Path variable causes the
‘mvn’ is not recognized as an internal or external command, operable program or
batch file error when using the mvn command.
Click OK in the Environment Variables window to save the changes to the system variables.

Step 4: Verify Maven Installation


In the command prompt, use the following command to verify the installation by checking
the current version of Maven:
mvn -version

RESULT:
Thus, Maven is installed and ready to use on the Windows system.
EX NO: 4 Gradle Installation and Understanding Build using Gradle
DATE:

AIM:
To install Apache Maven on Windows.
STEPS:
Step 1. Download the latest Gradle distribution
• The distribution zip file comes in two flavors:
1. Binary-only
2. Complete, with docs and sources
Step 2. Unpack the distribution Microsoft Windows users:
• unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.
Step 3. Configure your system environment.
Microsoft Windows users
In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System
Settings -> Environmental Variables.
Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-8.6\bin. Click OK to
save.
Step 4. Verify your installation Open a console (or a Windows command prompt) and run gradle -v to run
gradle and display the version.
$ gradle -v
Understanding Build using Gradle
Steps to create Java application using Gradle
Step 1. Initializing the Project
Step 2. Understanding the Directory layout
Step 3. Review the Gradle Files
Step 4. Review the Code
Step 5. Run the App
Step 6. Bundle the App
Step 7. Publish a Build Scan

Initializing the Project


• Create a new directory called gradlesample and change directory into it.
• Enter gradle init and hit enter. It will ask for type of project as shown below

Initializing the Project


• It will ask for type of project and as it is basic type 1
• Type 1 to use groovy
• Simply hit enter for project name to accept default name for the project.
Understanding the Directory layout

settings.gradle

build.gradle
.gitignore

Review the Code


• create the directory src/main/java
• create a package of com.devop
• in that package create a new Java source file Gradlesample.java
• add the following Gradlesample class with a main method for displaying the current time.
Gradlesample.java

build.gradle
Adding code for testing
• create the directory structure src/test/java, then the same package structure com.devop
• create a Gradlesampletest.java source file, and inside add this test class which uses the JUnit 4 library.

Run the App


run the executable jar

Build directory and Reports directory after build cmd in Project directory
Publish a Build Scan
• Again run the build task with scan
• can consult a test report generated in build/reports/tests/test
• Open the index.html file in a browser and see that 1 test was executed with 0 failures. Or
• Execute gradlew build --scan to see detailed report
RESULT:
Thus Gradle is installed on windows and executed simple gradle project.
EX NO: 5 Jenkins Installation and Creation of freestyle project
DATE:

AIM:
To install Jenkins and to create a freestyle project.
STEPS:
INSTALLATION
1. Browse to the official Jenkins download page. Under the Downloading Jenkins section is a
list of installers for the long-term support (LTS) version of Jenkins. Click the Windows link
to begin the download.
2. Once the download is complete, run the jenkins.msi installation file.
3. The setup wizard starts. Click Next to proceed.

4. Select the install destination folder and click Next to continue.


5. Under the Run service as a local or domain user option, enter the domain username and
password for the user account you want to run Jenkins with. Click Test Credentials to
verify the login data, then click Next to proceed.

6. Enter the port number you want Jenkins to run on. Click Test Port to check if the selected
port is available, then click Next to continue.
7. Select the directory where Java is installed on your system and click Next to proceed.

8. Select the features you want to install with Jenkins and click Next to continue.

9. Click Install to start the installation process.


10. Once the installation is complete, click Finish to exit the install wizard.

Unblock Jenkins
After completing the installation process, you have to unblock Jenkins before you can
customize and start using it.

1. In your web browser, navigate to the port number you selected during the installation
using the following address:

http://localhost:[port number]

2. Navigate to the location on your system specified by the Unblock Jenkins page.
3. Open the initialAdminPassword file using a text editor such as Notepad.

4. Copy the password from the initialAdminPassword file.

5. Paste the password in the Administrator password field on the Unblock Jenkins page and
click Continue to proceed.

Customize Jenkins
Once you unlock Jenkins, customize and prepare the Jenkins environment.

1. Click the Install suggested plugins button to have Jenkins automatically install the most
frequently used plugins.

2. After Jenkins finishes installing the plugins, enter the required information on the Create
First Admin User page. Click Save and Continue to proceed.
3. On the Instance Configuration page, confirm the port number you want Jenkins to use
and click Save and Finish to finish the initial customization.

4. Click the Start using Jenkins button to move to the Jenkins dashboard.
Creation of freestyle project

1. Access Jenkins from the internet and log in by using the credentials.
2. Give the name of the project and select the freestyle project as show in the image
below. And click on ok after selecting.
3. You need to configure all the required configurations required for the project which you
want to build.
RESULT:
Thus Jenkins is installed and created a simple freestyle project.
EX NO: 6 Jenkins Pipeline
DATE:

AIM:
To create a pipeline in Jenkins.
STEPS:
1. On the Jenkins dashboard, click on New Item. Then enter an item name, for
example, ‘pipeline’ and select the ‘Pipeline’ project. Then click on, OK.
2. You need to configure all the required configurations required for the project which you
want to build.

3. Under pipeline section, select “pipeline script from SCM” from the drop down
menu.

4. Enter your Github repository Url and credentials.


Specify */main as branch specifier.
Then click apply.
5. Click Build Now to build your pipeline.
RESULT:

Thus pipeline was created successfully.


EX NO: 7 Create Maven Build pipeline in Azure
DATE:

AIM:
To create Maven Build pipeline in Azure
STEPS:
Step 1: Set up Azure DevOps Project
From the Azure Portal, browse to All services, search for DevOps and select Azure DevOps.
This will open the Azure DevOps dashboard.

Next, click My Azure DevOps Organizations and provide your Azure credentials. You will be
brought to a page where you can create a new organization as shown below. Once here, click
on the blue Create new organization button.

On the next page, provide a name for the organization.. Once done, click Continue.
Creating an Azure DevOps Project

The next step is creating a project. A project is a container for the pipeline .

On the project creation page, provide a name for your project in the Project name field. For
this project. Confirm the creation of the project by clicking the + Create Project button.

At this point, your Azure DevOps workspace (project + organization) has been created.
Building an Azure DevOps Build Pipeline
Now that you have an Azure DevOps organization and project set up, you can now create a build
pipeline inside. It’s where you will create builds to perform various tasks like compiling code,
bringing in dependencies and more.

1.From the dashboard, select Pipelines then on Builds.

2. Click on New pipeline to begin creating the build pipeline.

3.You will then be prompted for where your code is stored. In this Project, the code is stored in a
GitHub repository. Select GitHub. This is the place where code is stored and the triggers for
invoking the build will come from.
4. Once you click on GitHub, you’ll be prompted to provide your GitHub account credentials as
shown below.

5. Next, confirm the step where you are asked to authorize Azure Pipelines. This ensures Azure
DevOps has permission to access your GitHub repos.
Linking a GitHub Repo to the Build Pipeline
Once you’ve provided Azure DevOps permission to your GitHub account, now link a GitHub repo
to the build pipeline.

1.Select the empty GitHub repo you have created for this Project. Choose the repository where your
Maven project is hosted.
2. Allow the project to read, write and check source code from the repository you selected earlier.
Then confirm this process by clicking Approve & Install.

3. Configure the Pipeline


1. Choose "Maven" as the pipeline template.
2. Azure DevOps will auto-generate a YAML file for the pipeline. Modify it as needed to fit
your project structure and requirements.

4. Define Stages and Tasks


configure above yaml scripts according to the maven project the you build.
1. Define stages for your pipeline. For example, "Build", "Test", etc.
2. Add tasks within each stage. For the Maven build pipeline, tasks may include:
- Maven task to build your project.
- Maven task to run regression tests.
5. Save and Run the Pipeline
1. Save your changes to the pipeline YAML file.
2. Run the pipeline to test it.
3. Monitor the pipeline execution for any errors or failures.

RESULT:
Thus, Maven Build pipeline is created in Azure and executed successfully.
EX NO:8 Create a Maven Build pipeline in Jenkins
DATE:

AIM:
To execute maven project using Jenkins pipeline.
STEPS:
1. Create a Maven project for Bubble sort
# Create a new directory for your Maven project
mkdir bubble-sort-project
cd bubble-sort-project

# Use Maven archetype to create a new Maven project


mvn archetype:generate -DgroupId=com.example -DartifactId=bubble-sort -
DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

2. Implement Bubble Sort Algorithm


// src/main/java/com/example/BubbleSort.java
package com.example;

public class BubbleSort {


public static void bubbleSort(int[] arr) {
int n = arr.length;
for (int i = 0; i < n-1; i++)
for (int j = 0; j < n-i-1; j++)
if (arr[j] > arr[j+1]) {
// swap arr[j+1] and arr[i]
int temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}

3. Write JUnit Tests:


// src/test/java/com/example/BubbleSortTest.java
package com.example;

import static org.junit.Assert.assertArrayEquals;


import org.junit.Test;

public class BubbleSortTest {


@Test
public void testBubbleSort() {
int[] arr = {5, 1, 4, 2, 8};
BubbleSort.bubbleSort(arr);
int[] expected = {1, 2, 4, 5, 8};
assertArrayEquals(expected, arr);
}
}

4. Build and Test Locally


# Build the project
mvn clean install

# Run tests
mvn test

5. Upload to GitHub
Create a new repository on GitHub and place src folder and POM.Xml in that
repository.
Now create a Jenkinsfile and write the following script
pipeline {
agent any

stages {
stage('Build') {
steps {
// Checkout the code from your Git repository
bat 'git clone https://github.com/Rsowmya26/dev.git'

// Build the Maven project


bat 'mvn clean package'
}
}
stage('Test') {
steps {
// Run Maven tests
bat 'mvn test'
}
}

stage('Run') {
steps {
bat 'java -cp target/classes com.example.bubblesort.BubbleSort'
}
}
}
}

6. Creating pipeline for the above Maven Project


RESULT:
Thus the maven project is build using Jenkins pipeline.
EX NO: 9 Install Ansible and execute Adhoc commands
DATE:
AIM:
To install Ansible in wsl2 Ubuntu , keeping as control node and connecting Windows as host
node.
STEPS:
1. Install ansible by executing following command in Ubuntu
sudo apt remove ansible
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
2. Check the installation

3. Ansible ad hoc commands enable you to perform tasks on remote nodes without having
to write a playbook.
4. Check the connection with local host

5. the -m parameter is the module option. Ping is the adhoc command and the second
parameter all represents all hosts in the inventory file. The output of the command is
shown below:
6. find the git version in remote window

7. List the directory in windows host

8. Create a directory in windows host


9. To find available physical memory in windows host .

10. Execute calculator form ansible

RESULT:
Thus ansible has been installed in wsl ubuntu and keeping windows as host node all the
adhoc commands are executed and verified.
EX NO : 10 INSTALLATION OF VLC MEDIA PLAYER IN WINDOWS HOST
DATE:

AIM:
To install ansible in wsl ubuntu and to connect to one windows host and install VLC media
player in windows host.

STEPS:
1. In windows host enable winrm
Get-NetConnectionProfile
Enable WinRM -Enable-PSRemoting

2. Enable Basic Auth – “Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value


$true”
3. Enable Unencrypted connectionSet-Item -Path
WSMan:\localhost\Service\AllowUnencrypted -Value $true
4. In WSL window

5. Open default hosts and define windows host


sudo vi /etc/ansible/hosts

6. Add the following code in hosts

7. Install pywinrm - pip install pywinrm


8. To test the connectivity with windows run the command as follows
9. Open ansi.yml play book and add the coding to download and install apache in
windows

10. Check the syntax of yml file

11. The content of ansi.yml file

12. The result after executing the ansible playbook ansi.yml

RESULT:
Thus VLC media player is installed in windows host from WSL Ubuntu ansible control
node.

You might also like