Find below Ansible playbook for installing Jenkins on a Ubuntu machine.
Pre-requistes:
Java needs to be installed already on machine before setting up Jenkins. please Click here for Java Playbook.
Please find steps for installing Apache software on nodes using Ansible in Ubuntu EC2:
sudo vi installJenkins.yml
Copy the below yellow highlighted in the above file:
---
- hosts: Java_Group
tasks:
- name: ensure the jenkins apt repository key is installed
apt_key: url=https://pkg.jenkins.io/debian-stable/jenkins.io.key state=present
become: yes
- name: ensure the repository is configured
apt_repository: repo='deb https://pkg.jenkins.io/debian-stable binary/' state=present
become: yes
- name: ensure jenkins is installed
apt: name=jenkins update_cache=yes
become: yes
- name: ensure jenkins is running
service: name=jenkins state=started
Pre-requistes:
Java needs to be installed already on machine before setting up Jenkins. please Click here for Java Playbook.
Please find steps for installing Apache software on nodes using Ansible in Ubuntu EC2:
sudo vi installJenkins.yml
Copy the below yellow highlighted in the above file:
---
- hosts: Java_Group
tasks:
- name: ensure the jenkins apt repository key is installed
apt_key: url=https://pkg.jenkins.io/debian-stable/jenkins.io.key state=present
become: yes
- name: ensure the repository is configured
apt_repository: repo='deb https://pkg.jenkins.io/debian-stable binary/' state=present
become: yes
- name: ensure jenkins is installed
apt: name=jenkins update_cache=yes
become: yes
- name: ensure jenkins is running
service: name=jenkins state=started
No comments:
Post a Comment