-
-
Save bhushanm90/31152fb52cae1fb04595163951cead96 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment