Created
October 28, 2014 04:19
-
-
Save tily/958597367dfedd875a00 to your computer and use it in GitHub Desktop.
jenkins + α の chef-apply 用レシピ
This file contains 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
hostname = ENV['HOSTNAME'] | |
pkgs = %w( | |
java-1.7.0-openjdk | |
java-1.7.0-openjdk-demo | |
java-1.7.0-openjdk-devel | |
java-1.7.0-openjdk-javadoc | |
java-1.7.0-openjdk-src | |
) | |
pkgs.each do |pkg| | |
package pkg do | |
action :install | |
end | |
end | |
execute 'install jenkins yum repository' do | |
command <<-EOC | |
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo && | |
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key | |
EOC | |
not_if { File.exists?('/etc/yum.repos.d/jenkins.repo') } | |
end | |
package 'jenkins' do | |
action :install | |
end | |
service 'jenkins' do | |
action [:enable, :start] | |
end | |
file '/etc/sysconfig/network' do | |
content <<-EOF | |
NETWORKING=yes | |
HOSTNAME=#{hostname} | |
EOF | |
end | |
execute 'set hostname' do | |
command "hostname #{hostname}" | |
end | |
package 's3cmd' do | |
action :install | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment