It is time to configure management server, on which beside Ansible I would also like to have Jenkins. In the future I will use it to build CI/CD pipeline.
In order to install Jenkins it is needed to meet some requirements, namely installing Java on target server. Beside installing Jenkins from repo let’s also make sure that that Jenkins service is started and enabled on startup and also open port 8080 on firewall to make Jenkins frontend accessible.
Below you can find task to setup management server in mgmt role:
One thing you can notice in my Ansible tasks is that I try to use .builtin modules whenever possible. This is to ensure compatibility since these modules are managed by Ansible (Redhat/IBM) themselves.
In order to execute the tasks navigate to playbooks directory andrun mgmt.yml playbook using this command:
After the execution you should see output similar to one below:
To make sure that Jenkins is running as intended let’s try to access it from host machine using IP address of server where the service is running. If you sticked to my naming convention that is http://192.168.0.224:8080/. After typing this address in the browser you should see Jenkins welcome message:
We have managed to successfully install Jenkins together with it’s dependencies, run the service and expose the needed port on management server in an automated, scalable way.
In my next posts I will describe setting up application server with separate Docker containers for backend, frontend and database servers.