https://github.com/mohammadrony/jenkins-docker-setup-playbook
An Ansible playbook to prepare Jenkins server, Docker and Kubectl in CentOS.
https://github.com/mohammadrony/jenkins-docker-setup-playbook
ansible ansible-playbook ansible-role docker jenkins jenkins-setup kubectl
Last synced: about 2 months ago
JSON representation
An Ansible playbook to prepare Jenkins server, Docker and Kubectl in CentOS.
- Host: GitHub
- URL: https://github.com/mohammadrony/jenkins-docker-setup-playbook
- Owner: mohammadrony
- Created: 2023-07-10T17:52:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T21:36:11.000Z (about 1 year ago)
- Last Synced: 2025-02-12T20:19:09.943Z (4 months ago)
- Topics: ansible, ansible-playbook, ansible-role, docker, jenkins, jenkins-setup, kubectl
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prepare Jenkins, Docker and Kubectl in CentOS 9
An Ansible playbook to prepare Jenkins server, Docker and Kubectl configuration in CentOS 9
## Pre-requisites
Prepare an Ansible connection from the control node to the managed node using the [Ansible setup](./pre-requisites/Ansible-setup-in-CentOS.md) document.
### Prepare kubernetes cluster
If you are to maintain a Kubernetes cluster from the Jenkins server with `kubectl`, you can follow the instructions in the [kubernetes-cluster-setup-playbook](https://github.com/mohammadrony/kubernetes-cluster-setup-playbook.git) repository to create a cluster with a master and worker node.
## Clone this repository
```bash
su - ansible
git clone https://github.com/mohammadrony/jenkins-docker-setup-playbook.git
```## Check ansible hosts file
Check [hosts](./hosts) file for host-group and host-names with control plane and worker node host names. By default, it would work as follows
```bash
[admin]
admin-server
```## Run Ansible playbook
```bash
ansible-playbook playbook.yml
```## Start Jenkins service
```bash
jenkins_host="admin-server"
ssh ${jenkins_host} "sudo systemctl start jenkins"
ssh ${jenkins_host} "sudo systemctl status jenkins"
```## Browse Jenkins dashboard from browser
- Visit URL from local browser.
- Find the initial admin password from ansible control host's `/home/ansible/jenkins-admintoken.txt` file or Jenkins server host's `/var/lib/jenkins/secrets/initialAdminPassword` file.Thank you.