Skip to content

Commit

Permalink
Rename server -> master
Browse files Browse the repository at this point in the history
After internal conversations, the term "server" is misleading. Even though
they are called "servers" in Jenkins land, that terminology is confusing to
users. Just like "slaves" are actually called "nodes" in Jenkins-land.

In order to make this cookbook as friendly as possible, we have chosen to
adopt the master-slave terminology to broadly refer to the server-node Jenkins
internally exhibits.

Since "node" and "server" already have meaning in the Chef context, we found
users were confused by these terminologies. Additionally, the community
commonly refers to Jenkins masters and Jenkins slaves/builders. As such, we
chose to adopt this naming schema to reduce/eliminate confusion.
  • Loading branch information
sethvargo committed Jan 9, 2014
1 parent 2f3ad52 commit a8464de
Show file tree
Hide file tree
Showing 37 changed files with 124 additions and 124 deletions.
6 changes: 3 additions & 3 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ provisioner:
data_path: test/shared
attributes:
jenkins:
server:
master:
host: localhost

platforms:
Expand All @@ -33,13 +33,13 @@ suites:
run_list: jenkins_smoke::default
attributes:
jenkins:
server:
master:
install_method: package
- name: jenkins_smoke_war
run_list: jenkins_smoke::default
attributes:
jenkins:
server:
master:
install_method: war

#
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jenkins Cookbook
================
[![Build Status](https://secure.travis-ci.org/opscode-cookbooks/jenkins.png?branch=master)](http://travis-ci.org/opscode-cookbooks/jenkins)

Installs and configures Jenkins CI server & node slaves. Resource providers to support automation via jenkins-cli, including job create/update.
Installs and configures Jenkins CI master & node slaves. Resource providers to support automation via jenkins-cli, including job create/update.


Requirements
Expand All @@ -18,8 +18,8 @@ In order to keep the README managable and in sync with the attributes, this cook

Recipes
-------
### server
The server recipe will create the required directory structure and install jenkins. There are two installation methods, controlled by the `node['jenkins']['server']['install_method']` attribute:
### master
The master recipe will create the required directory structure and install jenkins. There are two installation methods, controlled by the `node['jenkins']['master']['install_method']` attribute:

- `package` - Install Jenkins from the official jenkins-ci.org packages
- `war` - Download the latest version of the WAR file and configure it with Runit
Expand Down Expand Up @@ -205,7 +205,7 @@ jenkins_plugin 'greenballs' do
end
```

**NOTE** You may need to restart the Jenkins server after changing a plugin. Because this varies on a case-by-case basis (and because everyone chooses to manage their Jenkins servers differently) this LWRP does **NOT** restart Jenkins for you.
**NOTE** You may need to restart Jenkins after changing a plugin. Because this varies on a case-by-case basis (and because everyone chooses to manage their Jenkins infrastructure differently) this LWRP does **NOT** restart Jenkins for you.

### jenkins_slave
This resource manages Jenkins slaves, supporting the following actions:
Expand Down Expand Up @@ -393,7 +393,7 @@ node.set['jenkins']['executor']['private_key'] = private_key


### Proxies
If you need to pass through a proxy server to communicate between your masters and slaves, you will need to set a special node attribute:
If you need to pass through a proxy to communicate between your masters and slaves, you will need to set a special node attribute:

```ruby
node['jenkins']['executor']['proxy']
Expand Down
6 changes: 3 additions & 3 deletions attributes/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
executor['private_key'] = nil

#
# If you need to pass through a proxy server to communicate between your
# masters and slaves, you will need to set this node attribute. It should be
# set in the form `HOST:PORT`:
# If you need to pass through a proxy to communicate between your masters and
# slaves, you will need to set this node attribute. It should be set in the
# form `HOST:PORT`:
#
# node.set['jenkins']['executor']['proxy'] = '1.2.3.4'
#
Expand Down
54 changes: 27 additions & 27 deletions attributes/server.rb → attributes/master.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Cookbook Name:: jenkins
# Attributes:: server
# Attributes:: master
#
# Author: Doug MacEachern <dougm@vmware.com>
# Author: Fletcher Nichol <fnichol@nichol.ca>
Expand All @@ -23,39 +23,39 @@
# limitations under the License.
#

default['jenkins']['server'].tap do |server|
default['jenkins']['master'].tap do |master|
#
# The installation method - +package+ or +war+. On RedHat and Debian
# platforms, the installation method is to use the package from the official
# Apt/Yum repos. On other platforms, the default method is using the war
# file.
#
# node.set['jenkins']['server']['install_method'] = 'war'
# node.set['jenkins']['master']['install_method'] = 'war'
#
server['install_method'] = case node['platform_family']
master['install_method'] = case node['platform_family']
when 'debian', 'rhel' then 'package'
else 'war'
end

#
# The version of the Jenkins server to install. This can be a specific
# The version of the Jenkins master to install. This can be a specific
# package version (from the yum or apt repo), or the version of the war
# file to download from the Jenkins mirror.
#
server['version'] = nil
master['version'] = nil

#
# The mirror to donload the Jenkins war file. This attribute is only used
# in the "war" installation method.
#
# node.set['jenkins']['server']['mirror'] = 'http://cache.example.com'
# node.set['jenkins']['master']['mirror'] = 'http://cache.example.com'
#
# Note: this mirror is combined with some "smart" attributes to build the
# Jenkins war. If you are not using an actual Jenkins mirror, you might be
# more interested in the +source+ attribute, which accepts the full path
# to the war file for downloading.
#
server['mirror'] = 'http://mirrors.jenkins-ci.org'
master['mirror'] = 'http://mirrors.jenkins-ci.org'

#
# The full URL to the Jenkins WAR file on the remote mirror. This attribute is
Expand All @@ -65,88 +65,88 @@
# war file. If you choose to override this file manually, it is highly
# recommended that you also set the +checksum+ attribute.
#
# node.set['jenkins']['server']['source'] = 'http://fs01.example.com/jenkins.war'
# node.set['jenkins']['master']['source'] = 'http://fs01.example.com/jenkins.war'
#
# Warning: Setting this attribute will negate/ignore any values for +mirror+
# and +version+.
#
server['source'] = "#{server['mirror']}/war/#{server['version'] || 'latest'}/jenkins.war"
master['source'] = "#{master['mirror']}/war/#{master['version'] || 'latest'}/jenkins.war"

#
# The checksum of the war file. This is use to verify that the remote war file
# has not been tampered with (such as a MITM attack). If you leave this #
# attribute set to +nil+, no validation will be performed. If this attribute
# is set to the wrong MD5 checksum, the Chef Client run will fail.
#
# node.set['jenkins']['server']['checksum'] = 'abcd1234...'
# node.set['jenkins']['master']['checksum'] = 'abcd1234...'
#
server['checksum'] = nil
master['checksum'] = nil

#
# The list of options to pass to the Java JVM script when using the package
# installer. For example:
#
# node.set['jenkins']['server']['jvm_options'] = '-Xmx256m'
# node.set['jenkins']['master']['jvm_options'] = '-Xmx256m'
#
server['jvm_options'] = nil
master['jvm_options'] = nil

#
# The username of the user who will own and run the Jenkins process. You can
# change this to any user on the system. Chef will automatically create the
# user if it does not exist.
#
# node.set['jenkins']['server']['user'] = 'root'
# node.set['jenkins']['master']['user'] = 'root'
#
server['user'] = 'jenkins'
master['user'] = 'jenkins'

#
# The group under which Jenkins is running. Jenkins doesn't actually use or
# honor this attribute - it is used for file permission purposes.
#
server['group'] = 'jenkins'
master['group'] = 'jenkins'

#
# The host the Jenkins server is running on. For single-installs, the default
# The host the Jenkins master is running on. For single-installs, the default
# value of +localhost+ will suffice. For multi-node installs, you will likely
# need to update this attribute to the FQDN of your Jenkins master.
#
# If you are running behind a proxy, please see the documentation for the
# +endpoint+ attribute instead.
#
server['host'] = 'localhost'
master['host'] = 'localhost'

#
# The port which the Jenkins process will listen on.
#
server['port'] = 8080
master['port'] = 8080

#
# The top-level endpoint for the Jenkins server. By default, this is a
# "compiled" attribute from +jenkins.server.host+ and +jenkins.server.port+,
# The top-level endpoint for the Jenkins master. By default, this is a
# "compiled" attribute from +jenkins.master.host+ and +jenkins.master.port+,
# but you will need to change this attribute if you choose to serve Jenkins
# behind an HTTP(s) proxy. For example, if you have an Nginx proxy that runs
# Jenkins on port 80 on a custom domain with a proxy, you will need to set
# that attribute here:
#
# node.set['jenkins']['server']['endpoint'] = 'https://custom.domain.com/jenkins'
# node.set['jenkins']['master']['endpoint'] = 'https://custom.domain.com/jenkins'
#
server['endpoint'] = "http://#{server['host']}:#{server['port']}"
master['endpoint'] = "http://#{master['host']}:#{master['port']}"

#
# The path to the Jenkins home location. This will also become the value of
# +$JENKINS_HOME+. By default, this is the directory where Jenkins stores its
# configuration and build artifacts. You should ensure this directory resides
# on a volume with adequate disk space.
#
server['home'] = '/var/lib/jenkins'
master['home'] = '/var/lib/jenkins'

#
# The directory where Jenkins should write its logfile(s). **This attribute
# is only used by the package installer!**. The log directory will be owned
# by the same user and group as the home directory. If you need furthor
# customization, you should override these values in your wrapper cookbook.
#
# node.set['jenkins']['server']['log_directory'] = '/var/log/jenkins'
# node.set['jenkins']['master']['log_directory'] = '/var/log/jenkins'
#
server['log_directory'] = '/var/log/jenkins'
master['log_directory'] = '/var/log/jenkins'
end
14 changes: 7 additions & 7 deletions libraries/_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Helper
class JenkinsNotReady < StandardError
def initialize(endpoint, timeout)
super <<-EOH
The Jenkins server at `#{endpoint}' did not become ready within #{timeout}
The Jenkins master at `#{endpoint}' did not become ready within #{timeout}
seconds. On large Jenkins instances, you may need to increase the timeout to
#{timeout * 4} seconds. Alternatively, Jenkins may have failed to start.
Jenkins can fail to start if:
Expand All @@ -36,7 +36,7 @@ def initialize(endpoint, timeout)
- a plugin is only partially installed
- a plugin's dependencies are not installed
If this problem persists, check your server's log files.
If this problem persists, check your Jenkins's log files.
EOH
end
end
Expand Down Expand Up @@ -193,12 +193,12 @@ def proxy_given?
end

#
# The URL endpoint for the Jenkins server.
# The URL endpoint for the Jenkins master.
#
# @return [String]
#
def endpoint
node['jenkins']['server']['endpoint']
node['jenkins']['master']['endpoint']
end

#
Expand Down Expand Up @@ -234,10 +234,10 @@ def cli
# service endpoint(s) are _actually_ ready to accept requests.
#
# This method will effectively "block" the current thread until the Jenkins
# server is ready to accept CLI and HTTP requests.
# master is ready to accept CLI and HTTP requests.
#
# @raise [JenkinsNotReady]
# if the server does not respond within (+timeout+) seconds
# if the Jenkins master does not respond within (+timeout+) seconds
#
def wait_until_ready!
Timeout.timeout(timeout) do
Expand All @@ -259,7 +259,7 @@ def wait_until_ready!

#
# Idempotently download the remote +jenkins-cli.jar+ file for the Jenkins
# server. This method will raise an exception if the Jenkins master is
# master. This method will raise an exception if the Jenkins master is
# unavailable or is not accepting requests.
#
def ensure_cli_present!
Expand Down
2 changes: 1 addition & 1 deletion libraries/credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def current_credentials

#
# Helper method for determining if the given JSON is in sync with the
# current configuration on the Jenkins server.
# current configuration on the Jenkins instance.
#
# @return [Boolean]
#
Expand Down
12 changes: 6 additions & 6 deletions libraries/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def config(arg = nil)
end

#
# Determine if the job exists on the server. This value is set by the
# Determine if the job exists on the master. This value is set by the
# provider when the current resource is loaded.
#
# @return [Boolean]
Expand All @@ -75,7 +75,7 @@ def exists?
end

#
# Determine if the job is enabled on the server. This value is set by the
# Determine if the job is enabled on the master. This value is set by the
# provider when the current resource is loaded.
#
# @return [Boolean]
Expand All @@ -92,7 +92,7 @@ class JobDoesNotExist < StandardError
def initialize(job, action)
super <<-EOH
The Jenkins job `#{job}' does not exist. In order to #{action} `#{job}', that
job must first exist on the Jenkins server!
job must first exist on the Jenkins master!
EOH
end
end
Expand Down Expand Up @@ -131,8 +131,8 @@ def whyrun_supported?
# `config` XML file using the Jenkins CLI.
#
# This method also ensures the given configuration file matches the one
# rendered on the server. If the configuration file does not match, a new
# one is rendered.
# rendered on the Jenkins master. If the configuration file does not match,
# a new one is rendered.
#
# Requirements:
# - `config` parameter
Expand Down Expand Up @@ -247,7 +247,7 @@ def current_job

#
# Helper method for determining if the given JSON is in sync with the
# current configuration on the Jenkins server.
# current configuration on the Jenkins master.
#
# We have to create REXML objects and then remove any whitespace because
# XML is evil and sometimes sucks at the simplest things, like comparing
Expand Down
Loading

0 comments on commit a8464de

Please sign in to comment.