Created
March 3, 2018 18:45
-
-
Save seancallaway/39281aa0f2ab05b8e79d205f384d0ee2 to your computer and use it in GitHub Desktop.
Ansible Playbook for Installing Jenkins on Centos 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 |
ansible-galaxy install ansiblebit.oracle-java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
appreciated