Some new requirements have come up to install and configure some packages on the Nautilus infrastructure under Stratos Datacenter. The Nautilus DevOps team installed and configured a new Jenkins server so they wanted to create a Jenkins job to automate this task. Find below more details and complete the task accordingly:
Access the Jenkins UI by clicking on the Jenkins button in the top bar. Log in using the credentials: username admin and password Adm!n321.
Create a new Jenkins job named install-packages and configure it with the following specifications:
Add a string parameter named PACKAGE.
Configure the job to install a package specified in the $PACKAGE parameter on the storage server (Stratos Datacenter).
Build the job at least once (e.g. with parameter PACKAGE=vim-enhanced) so the package is installed on the Storage server and can be verified.
Note:
Ensure to install any required plugins and restart the Jenkins service if necessary. Opt for Restart Jenkins when installation is complete and no jobs are running on the plugin installation/update page. Refresh the UI page if needed after restarting the service.
Verify that the Jenkins job runs successfully on repeated executions to ensure reliability.
Capture screenshots of your configuration for documentation and review purposes. Alternatively, use screen recording software like loom.com for comprehensive documentation and sharing.
Step 1: Access Jenkins UI
Click the Jenkins button in the top bar and log in with:
-
Username:
admin -
Password:
Adm!n321
Step 2: Install Required Plugin
The Publish Over SSH plugin is recommended for this task, as it allows Jenkins to execute commands on remote servers directly .
- Go to Manage Jenkins → Plugins → Available
- Search for "Publish Over SSH"
- Check the box and click Install without restart
- If prompted, select "Restart Jenkins when installation is complete and no jobs are running"
Refresh the UI page after Jenkins restarts.
Step 3: Configure SSH Connection to Storage Server
Before creating the job, you need to set up SSH connectivity from Jenkins to ststor01:
- Go to Manage Jenkins → Configure System
- Scroll down to Publish over SSH section
- Click Add to create a new SSH server
- Configure with these details:
-
Name:
ststor01 -
Hostname:
ststor01 -
Username:
natasha -
Remote Directory:
/home/natasha(or leave blank) -
Password:
Bl@kW(or use key-based authentication)
-
Name:
- Click Test Configuration to verify connectivity
- Click Save
Step 4: Create the install-packages Job
- From the dashboard, click New Item
- Enter name:
install-packages - Select Freestyle project
- Click OK
Step 5: Add the PACKAGE Parameter
- In the job configuration, scroll to General
- Check "This project is parameterized"
- Click Add Parameter → select String Parameter
- Configure the parameter:
-
Name:
PACKAGE -
Default Value:
vim-enhanced(or leave blank) -
Description:
Enter the package name to install on the storage server
-
Name:
- Click Save
Step 6: Configure Build Step to Install Package
- Scroll down to the Build section
- Click Add build step → select Send files or execute commands over SSH
- Select the server:
ststor01 - In the Exec command field, add:
sudo yum install -y $PACKAGE || sudo apt-get install -y $PACKAGE
Important: The natasha user needs passwordless sudo access. If you encounter a sudo: sorry, you must have a tty to run sudo error, the Jenkins server admin must add this entry to the sudoers file on ststor01 :
natasha ALL=(ALL) NOPASSWD: ALL
Or alternatively, disable the TTY requirement:
Defaults:natasha !requiretty
- Click Save
Step 7: Build the Job
- From the job page, click Build with Parameters
- Enter a package name, e.g.,
vim-enhanced - Click Build
- Click Console Output to monitor the build progress and verify success
Step 8: Verify Installation
After the build succeeds, SSH into ststor01 and verify:
ssh natasha@ststor01
rpm -qa | grep vim-enhanced # For RHEL/CentOS
# OR
dpkg -l | grep vim-enhanced # For Ubuntu/Debian
Step 9: Test Repeated Executions
Run the job again with different packages (e.g., curl, git) to ensure the job works reliably on repeated executions .
Summary
| Step | Action |
|---|---|
| 1 | Log in to Jenkins UI (admin / Adm!n321) |
| 2 | Install Publish Over SSH plugin |
| 3 | Configure SSH connection to ststor01
|
| 4 | Create Freestyle job named install-packages
|
| 5 | Add String Parameter PACKAGE
|
| 6 | Configure build step with SSH command |
| 7 | Build with parameter (e.g., vim-enhanced) |
| 8 | Verify installation on storage server |
| 9 | Test repeatedly for reliability |
Key Points:
- Use Publish Over SSH plugin for reliable remote execution
- Ensure
natashahas passwordless sudo access onststor01 - Test the job multiple times with different packages to ensure reliability
Top comments (0)