Skip to content

Instantly share code, notes, and snippets.

@yujiod
Last active November 6, 2015 00:42
Show Gist options
  • Save yujiod/d242b102e43922a0c784 to your computer and use it in GitHub Desktop.
Save yujiod/d242b102e43922a0c784 to your computer and use it in GitHub Desktop.
Install Jenkins and PHP5.6 by Ansible to CentOS6
#!/bin/sh
ansible-playbook -i inventory jenkins.yml
127.0.0.1 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_private_key_file=~/.ssh/id_rsa_ciserver
---
- hosts: all
tasks:
# Add IUS Commmunity repository
- name: add epel repository
yum: name=epel-release
- name: add IUS Commmunity repository
yum: name=http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-14.ius.el6.noarch.rpm
- name: add IUS Commmunity repository key
rpm_key: key=http://dl.iuscommunity.org/pub/ius/IUS-COMMUNITY-GPG-KEY state=present
# Add Jenkins repository
- name: add jenkins repository
get_url: url=http://pkg.jenkins-ci.org/redhat/jenkins.repo dest=/etc/yum.repos.d/jenkins.repo
- name: add jenkins repository key
rpm_key: key=http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key state=present
# Installing packages
- name: Install packages
yum: name={{item}}
with_items:
- perl
- git
- wget
- bzip2
- zip
- vim
- php56u-cli
- php56u-mbstring
- php56u-mcrypt
- php56u-pdo
- php56u-mysql
- php56u-pecl-xdebug
- php56u-opcache
- php56u-process
- php56u-xml
- java-1.8.0-openjdk
- java-1.8.0-openjdk-devel
- jenkins
- name: ensure jenkins is running
service: name=jenkins state=started enabled=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment