DevOps Lab Viva Questions and Answers (Lab 5 to Lab 12)
Lab 5: Introduction to Jenkins
1. What is Jenkins and why use it?
Jenkins is an open-source automation server used to automate parts of the software development
process like building, testing, and deploying code. It helps implement Continuous Integration (CI)
and Continuous Deployment (CD).
2. How do you install Jenkins locally or on the cloud?
You can install Jenkins on local systems using package managers (e.g., apt , yum ) or use Docker.
For cloud, services like Azure, AWS, or GCP offer pre-configured Jenkins VMs.
3. What is the architecture of Jenkins?
Jenkins has a master-agent architecture. The master schedules builds and manages tasks, while
agents (nodes) perform the builds on different platforms.
4. How is Jenkins configured for the first time?
After installation, Jenkins asks for an initial admin password and installs recommended plugins.
Then, you can create user accounts and configure tools like Git and Maven.
5. What are Jenkins plugins?
Plugins extend Jenkins functionality. Examples: Git Plugin, Pipeline Plugin, Email Extension Plugin.
6. What is a Jenkins job?
A job is a task that Jenkins performs, such as building code or running tests. Types: Freestyle project
and Pipeline project.
7. What is a Jenkins pipeline?
A Jenkins pipeline is a suite of plugins that allows you to define stages of your build process using
code in a Jenkinsfile.
8. How do you integrate Jenkins with Git?
Install Git plugin → Add Git repository URL in job configuration → Add credentials and configure
polling/webhooks.
9. How do you secure Jenkins?
Use role-based access control, secure credentials using Credentials plugin, install only trusted
plugins, and enable HTTPS.
1
10. What is a build trigger in Jenkins?
Build triggers start jobs automatically, e.g., on code push, scheduled time, after other jobs, or
manually.
Lab 6: Continuous Integration with Jenkins
1. How to set up a CI pipeline using Jenkins and Maven/Gradle?
Create a new job → Configure SCM → Add build steps (e.g., mvn clean install or gradle
build ) → Post-build actions.
2. What are Jenkins credentials?
Securely stored values (e.g., usernames, passwords, tokens) used in jobs to access Git or deploy
applications.
3. Example of a basic Jenkinsfile for Maven build:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'mvn clean install'
}
}
}
}
4. How do you view logs and artifacts in Jenkins?
Each job run shows console output and archived artifacts like JARs under the job workspace.
5. What are post-build actions?
Actions like sending notifications, publishing test reports, archiving artifacts after the build.
6. How do you integrate unit testing in Jenkins?
Add testing in the build script (e.g., mvn test ) and configure Jenkins to publish test reports.
7. What is parallel execution in Jenkins?
Allows running multiple stages or jobs simultaneously to save time using the parallel directive in
pipelines.
8. How do you roll back in Jenkins?
Trigger a previous successful build or redeploy a saved artifact.
2
9. How do environment variables work in Jenkins?
Used to pass information into scripts and builds. Set in job config or Jenkinsfile.
10. How to scale Jenkins?
Use multiple agents to run builds in parallel across platforms.
Lab 7: Configuration Management with Ansible (You installed figlet)
1. What is Ansible?
Ansible is an open-source tool for configuration management, application deployment, and task
automation using playbooks.
2. What is an inventory in Ansible?
A file (usually inventory.ini ) listing hosts on which tasks will run.
3. What is an Ansible playbook?
A YAML file defining a series of tasks to configure hosts.
4. How did you install figlet using Ansible?
- hosts: all
become: yes
tasks:
- name: Install figlet
apt:
name: figlet
state: present
5. What are Ansible modules?
Reusable units of work, like apt , copy , file , service , etc.
6. How to run a playbook for one host?
ansible-playbook -i inventory.ini playbook.yml --limit hostname
7. What is ansible.cfg ?
A config file defining default settings like inventory path, roles path, etc.
8. What is idempotency?
Tasks will not run if the desired state is already achieved.
3
9. Ad-hoc command vs playbook?
Ad-hoc: One-time task from CLI. Playbook: Series of tasks written in YAML.
10. How to pass variables?
Use --extra-vars flag or vars in playbook.
Lab 8: Jenkins CI + Ansible Deployment
1. How to build in Jenkins and deploy with Ansible?
Use Jenkins to compile and package, then run Ansible playbook as a post-build step.
2. How to execute an Ansible playbook from Jenkins?
Use "Execute shell" step: ansible-playbook -i inventory.ini deploy.yml
3. How to share build artifacts with Ansible?
Archive artifacts in Jenkins and pass the path to the playbook using parameters.
4. How to ensure deployment waits for build?
Use a pipeline stage or post-build action after a successful build.
5. How to roll back failed deployments?
Use Ansible tags to define rollback tasks or redeploy previous artifact.
6. How does Jenkins pass variables to Ansible?
Using environment variables or --extra-vars in CLI.
7. Which Jenkins plugin supports Ansible?
Ansible Plugin (enables Ansible execution in job steps).
8. How do you test deployment success?
Verify via service status, application response, or Ansible wait_for module.
9. What is artifact promotion?
Moving artifacts from one environment to another (e.g., from staging to production).
10. How to notify success/failure after deployment?
Use Jenkins Email, Slack, or webhook notifications in post-build actions.
(Labs 9-12 continued in next section due to length)