Skip to content

Instantly share code, notes, and snippets.

@bhushanm90
Forked from seancallaway/install_jenkins.yml
Created April 19, 2019 13:58
Show Gist options
  • Save bhushanm90/31152fb52cae1fb04595163951cead96 to your computer and use it in GitHub Desktop.
Save bhushanm90/31152fb52cae1fb04595163951cead96 to your computer and use it in GitHub Desktop.
Ansible Playbook for Installing Jenkins on Centos 7
---
- hosts: jenkins
roles:
- role: ansiblebit.oracle-java
oracle_java_set_as_default: yes
tasks:
- name: Ensure Jenkins Repository is Installed
yum_repository:
name: jenkins
state: present
description: Official Jenkins Yum Repo
baseurl: http://pkg.jenkins.io/redhat
gpgkey: https://jenkins-ci.org/redhat/jenkins-ci.org.key
gpgcheck: yes
enabled: yes
- name: Ensure Jenkins is Installed
yum :
name: jenkins
update_cache: yes
state: present
- name: Enable and Start the Jenkins Service
service:
name: jenkins
enabled: yes
state: started
- name: Open Firewall Port
firewalld:
zone: public
port: 8080/tcp
permanent: true
state: enabled
immediate: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment