Skip to content

Instantly share code, notes, and snippets.

@seancallaway
Created March 3, 2018 18:45
Show Gist options
  • Save seancallaway/39281aa0f2ab05b8e79d205f384d0ee2 to your computer and use it in GitHub Desktop.
Save seancallaway/39281aa0f2ab05b8e79d205f384d0ee2 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
@kupadhyay1212
Copy link

appreciated

@ChaitanyaChandra
Copy link

ansible-galaxy install ansiblebit.oracle-java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment