In this document, I will show how to configure Jenkins master and slave nodes. In the slave nodes, AWS CLI and Docker must be installed and configured. All of the topology will be configured with Vagrant.
The network topology will be as following:
I have used my WiFi card as the public network to direct connection in the Virtual machines. For that, you need to change your own Physical or WiFi card in the Vagrantfile configuration file.
Download codes from git repository and start all machines:
$ git clone https://github.com/jamalshahverdiev/vagrant-codes-in-practice.git $ cd vagrant-codes-in-practice/jenkins-gitlab-gogs-webdeploy $ vagrant up
Get ‘admin’ password for Jenkins master server:
$ vagrant ssh JenkMaster -c 'sudo cat /var/lib/jenkins/secrets/initialAdminPassword' 6990a0935e7149c28cacbf3a3110328a
Default login for Nexus is ‘admin’ and password is ‘admin123’. Jenkins listens on port 8080 and Nexus listens on port 8081.
Login to the Jenkins server:
Go to the ‘Manage Jenkins’ -> ‘Manage Plugins’
At the end of list select ‘All’ -> ‘Download now and install after restart’
Then go to the ‘Manage Jenkins’ -> ‘Manage Plugins’ -> ‘Available’ tab and then select checkbox ‘Self-Orginizing Swarm Plug-In Modules’ and then press the ‘Download now and install after restart’ button.
Create user for our slave nodes(This username and password is defined in our /etc/rc.local file for each of nodes). Go to the ‘Manage Jenkins’ -> ‘Manage Users’ -> ‘Create User’ then add username and password and press to the ‘Create User’ button
Before connection slave nodes go to the -> ‘Manage Jenkins’ -> ‘Configure Global Security’
In the ‘TCP port for JNLP agents’ -> ‘Random’ and then press ‘Save’ button:
Note it is important and there is a bug in the Jenkins. Before start slave nodes do the following thing in the master node. Go to the ‘Manage Jenkins’ -> ‘Configure System’ and then press ‘Save’ button.
At the end we must see the similar result as flowing: