default['cdh']['yum_mirror']['user'] = 'yum-mirror'
default['cdh']['yum_mirror']['cron_period'] = '#0 4 * * *' # default: inactive
default['cdh']['yum_mirror']['base_path'] = '/var/spool/cdh-mirror'
+default['cdh']['yum_mirror']['yum_conf'] = value_for_platform_family(
+ 'debian' => '/etc/yum/yum.conf',
+ 'rhel' => '/etc/yum.conf'
+)
+default['cdh']['yum_mirror']['repos_dir'] = value_for_platform_family(
+ 'debian' => '/etc/yum/repos.d',
+ 'rhel' => '/etc/yum.repos.d'
+)
+default['cdh']['yum_mirror']['repo_ids'] = []
+default['cdh']['yum_mirror']['arch'] = ''
+default['cdh']['yum_mirror']['url_alias_with_authority_part'] = true
#default['cdh'][''] =
--- /dev/null
+#
+# Cookbook Name:: cdh
+# Recipe:: yum_mirror
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+::Chef::Recipe.send(:include, Commons::PackageUtils)
+::Chef::Recipe.send(:include, YumUtils::RepoUtils)
+
+prefix = 'cdh'
+yum_mirror = node['cdh']['yum_mirror']
+
+reposync_sources, url_aliases = reposync_base_setup(
+ yum_mirror['user'],
+ yum_mirror['base_path'],
+ yum_mirror['yum_conf'],
+ yum_mirror['repos_dir'],
+ yum_mirror['repo_ids'],
+ yum_mirror['arch'],
+ yum_mirror['url_alias_with_authority_part']
+)
+
+template "/usr/local/bin/#{prefix}-mirror" do
+ source "usr/local/bin/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0755'
+ variables({
+ :reposync_sources => reposync_sources
+ })
+end
+
+pkg = get_cron_pkg_name
+resources(:package => pkg) rescue package pkg do
+ action :install
+end
+
+template "/etc/cron.d/#{prefix}-mirror" do
+ source "etc/cron.d/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0644'
+end
+
+httpd_service = get_httpd_pkg_name
+httpd_conf_path = nil
+
+case node[:platform_family]
+when 'debian'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror"
+when 'rhel'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror.conf"
+end
+
+pkg = httpd_service
+resources(:package => pkg) rescue package pkg do
+ action :install
+end
+
+resources(:service => httpd_service) rescue service httpd_service do
+ action [:enable, :start]
+ supports :status => true, :restart => true, :reload => true
+end
+
+template httpd_conf_path do
+ source "etc/apache2/conf.d/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0644'
+ variables({
+ :url_aliases => url_aliases
+ })
+ notifies :restart, "service[#{httpd_service}]"
+end
+
--- /dev/null
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%
+@url_aliases.each do |url_path, real_path|
+-%>
+Alias <%= url_path %> <%= real_path %>
+<Directory <%= real_path %>>
+ Options Indexes SymLinksIfOwnerMatch FollowSymLinks
+ IndexOptions NameWidth=* +SuppressDescription
+ AllowOverride FileInfo Indexes
+ Order Deny,Allow
+ Allow from all
+ ErrorDocument 404 default
+</Directory>
+
+<%
+end
+-%>
+
--- /dev/null
+#
+# Regular cron jobs for the yum-mirror
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%= node['cdh']['yum_mirror']['cron_period'] %> <%= node['cdh']['yum_mirror']['user'] %> /usr/local/bin/cdh-mirror > <%= node['cdh']['yum_mirror']['base_path'] %>/var/cron.log 2>&1
--- /dev/null
+#!/bin/sh
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%
+@reposync_sources.each do |source|
+-%>
+echo -n 'Begin time: '; date
+<%= source['reposync_command'] %>
+<%= source['createrepo_command'] %>
+echo -n 'End time: '; date
+
+<%
+end
+-%>
+
'rhel' => '/etc/yum.repos.d'
)
default['hdp']['yum_mirror']['repo_ids'] = []
+default['hdp']['yum_mirror']['url_alias_with_authority_part'] = true
#default['hdp'][''] =
::Chef::Recipe.send(:include, Commons::PackageUtils)
::Chef::Recipe.send(:include, YumUtils::RepoUtils)
+prefix = 'hdp'
+yum_mirror = node['hdp']['yum_mirror']
# HDP supports only x86_64 architecture.
arch = 'x86_64'
-mirror_user = node['hdp']['yum_mirror']['user']
-base_path = node['hdp']['yum_mirror']['base_path']
-%w{
- yum-utils
- createrepo
-}.each {|pkg|
- resources(:package => pkg) rescue package pkg do
- action :install
- end
-}
-
-resources(:group => mirror_user) rescue group mirror_user do
- system true
- action :create
-end
-
-resources(:user => mirror_user) rescue user mirror_user do
- gid mirror_user
- system true
- home base_path
- shell '/bin/sh'
- password nil
- action :create
-end
-
-httpd_service = get_httpd_pkg_name
-httpd_conf_path = nil
-
-case node[:platform_family]
-when 'debian'
- httpd_conf_path = "/etc/#{httpd_service}/conf.d/hdp-mirror"
-when 'rhel'
- httpd_conf_path = "/etc/#{httpd_service}/conf.d/hdp-mirror.conf"
-end
-
-pkg = get_cron_pkg_name
-resources(:package => pkg) rescue package pkg do
- action :install
-end
-
-[
- '',
- 'mirror',
- 'var',
-].each {|subdir|
- directory "#{base_path}/#{subdir}" do
- owner mirror_user
- group mirror_user
- mode '0755'
- recursive true
- end
-}
-
-repos = parse_repo_files(node['hdp']['yum_mirror']['repos_dir'])
-
-reposync_sources = []
-http_aliases = {}
-node['hdp']['yum_mirror']['repo_ids'].each {|repo_id|
- unless repos.has_key?(repo_id) then
- Chef::Application.fatal!("Yum repository definition (id: #{repo_id}) not found!")
- end
-
- repo = repos[repo_id]
- ctx_path = repo['baseurl'].gsub(/^http:\/\/[^\/]*\//, '')
-
- local_path = "#{base_path}/mirror/#{ctx_path}"
- if local_path.end_with?('/') then
- local_path.chop!
- end
- local_parent_path = File.dirname(local_path)
- actual_repo_path = "#{local_parent_path}/#{repo_id}"
- local_gpgkey_path = "#{base_path}/mirror/#{repo['gpgkey'].gsub(/^http:\/\/[^\/]*\//, '')}"
-
- [
- local_parent_path,
- actual_repo_path,
- File.dirname(local_gpgkey_path)
- ].each {|dir|
- resources(:directory => dir) rescue directory dir do
- owner mirror_user
- group mirror_user
- mode '0755'
- recursive true
- end
- }
-
- link local_path do
- to actual_repo_path
- end
-
- resources(:remote_file => local_gpgkey_path) rescue remote_file local_gpgkey_path do
- source repo['gpgkey']
- owner mirror_user
- group mirror_user
- mode '0644'
- end
-
- reposync_sources.push(
- {
- 'id' => repo_id,
- 'local_path' => local_path,
- 'reposync_command' => "reposync -c #{node['hdp']['yum_mirror']['yum_conf']} -a #{arch} -r #{repo_id} -p #{local_parent_path}",
- 'createrepo_command' => "createrepo #{local_path}"
- }
- )
-
- ctx_path_top = ctx_path.split('/')[0]
- http_aliases["/#{ctx_path_top}"] = "#{base_path}/mirror/#{ctx_path_top}"
-}
-
-template '/usr/local/bin/hdp-mirror' do
- source 'usr/local/bin/hdp-mirror'
+reposync_sources, url_aliases = reposync_base_setup(
+ yum_mirror['user'],
+ yum_mirror['base_path'],
+ yum_mirror['yum_conf'],
+ yum_mirror['repos_dir'],
+ yum_mirror['repo_ids'],
+ arch,
+ yum_mirror['url_alias_with_authority_part']
+)
+
+template "/usr/local/bin/#{prefix}-mirror" do
+ source "usr/local/bin/#{prefix}-mirror"
owner 'root'
group 'root'
mode '0755'
})
end
-template '/etc/cron.d/hdp-mirror' do
- source 'etc/cron.d/hdp-mirror'
+pkg = get_cron_pkg_name
+resources(:package => pkg) rescue package pkg do
+ action :install
+end
+
+template "/etc/cron.d/#{prefix}-mirror" do
+ source "etc/cron.d/#{prefix}-mirror"
owner 'root'
group 'root'
mode '0644'
end
+httpd_service = get_httpd_pkg_name
+httpd_conf_path = nil
+
+case node[:platform_family]
+when 'debian'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror"
+when 'rhel'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror.conf"
+end
+
pkg = httpd_service
resources(:package => pkg) rescue package pkg do
action :install
end
template httpd_conf_path do
- source 'etc/apache2/conf.d/hdp-mirror'
+ source "etc/apache2/conf.d/#{prefix}-mirror"
owner 'root'
group 'root'
mode '0644'
variables({
- :http_aliases => http_aliases
+ :url_aliases => url_aliases
})
notifies :restart, "service[#{httpd_service}]"
end
#
<%
-@http_aliases.each do |url_path, real_path|
+@url_aliases.each do |url_path, real_path|
-%>
Alias <%= url_path %> <%= real_path %>
<Directory <%= real_path %>>
'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6'
}
+# Repository mirroring by rsync
default['yum_utils']['mirror']['user'] = 'yum-mirror'
default['yum_utils']['mirror']['cron_period'] = '#0 2 * * *' # default: inactive
default['yum_utils']['mirror']['base_path'] = '/var/spool/yum-mirror'
=end
]
+# Repository mirroring by reposync
+default['yum_utils']['reposync_mirror']['user'] = 'yum-mirror'
+default['yum_utils']['reposync_mirror']['cron_period'] = '#0 3 * * *' # default: inactive
+default['yum_utils']['reposync_mirror']['base_path'] = '/var/spool/yum-reposync-mirror'
+default['yum_utils']['reposync_mirror']['yum_conf'] = value_for_platform_family(
+ 'debian' => '/etc/yum/yum.conf',
+ 'rhel' => '/etc/yum.conf'
+)
+default['yum_utils']['reposync_mirror']['repos_dir'] = value_for_platform_family(
+ 'debian' => '/etc/yum/repos.d',
+ 'rhel' => '/etc/yum.repos.d'
+)
+default['yum_utils']['reposync_mirror']['repo_ids'] = []
+default['yum_utils']['reposync_mirror']['arch'] = ''
+default['yum_utils']['reposync_mirror']['url_alias_with_authority_part'] = true
+
module YumUtils
module RepoUtils
+ def create_mirror_user(name, home_dir)
+ resources(:group => name) rescue group name do
+ system true
+ action :create
+ end
+
+ resources(:user => name) rescue user name do
+ gid name
+ system true
+ home home_dir
+ shell '/bin/sh'
+ password nil
+ action :create
+ end
+ end
+
+
+ def create_mirror_dirs(mirror_user, base_path)
+ [
+ '',
+ 'mirror',
+ 'var',
+ ].each {|subdir|
+ directory "#{base_path}/#{subdir}" do
+ owner mirror_user
+ group mirror_user
+ mode '0755'
+ recursive true
+ end
+ }
+ end
+
+
def parse_repo_files(repos_dir)
repos = {}
current_repo = nil
repos[repo_id] = current_repo
else
prop = line.split('=')
- current_repo[prop[0]] = prop[1]
+ current_repo[prop[0].strip] = prop[1].strip
end
}
}
return repos
end
+
+
+ def install_reposync()
+ %w{
+ yum-utils
+ createrepo
+ }.each {|pkg|
+ resources(:package => pkg) rescue package pkg do
+ action :install
+ end
+ }
+ end
+
+
+ def reposync_base_setup(
+ mirror_user,
+ base_path,
+ yum_conf_path,
+ repos_dir,
+ repo_ids,
+ arch,
+ url_alias_with_authority_part = true)
+
+ install_reposync()
+ create_mirror_user(mirror_user, base_path)
+ create_mirror_dirs(mirror_user, base_path)
+
+ repos = parse_repo_files(repos_dir)
+
+ reposync_sources = []
+ url_aliases = {}
+ repo_ids.each {|repo_id|
+ unless repos.has_key?(repo_id) then
+ Chef::Application.fatal!("Yum repository definition (id: #{repo_id}) not found!")
+ end
+
+ repo = repos[repo_id]
+ ctx_path = repo['baseurl'].gsub(/^http:\/\//, '')
+ gpgkey_ctx_path = repo['gpgkey'].gsub(/^http:\/\//, '')
+
+ local_path = "#{base_path}/mirror/#{ctx_path}"
+ if local_path.end_with?('/') then
+ local_path.chop!
+ end
+ local_parent_path = File.dirname(local_path)
+ actual_repo_path = "#{local_parent_path}/#{repo_id}"
+ local_gpgkey_path = "#{base_path}/mirror/#{gpgkey_ctx_path}"
+
+ [
+ local_parent_path,
+ actual_repo_path,
+ File.dirname(local_gpgkey_path)
+ ].each {|dir|
+ resources(:directory => dir) rescue directory dir do
+ owner mirror_user
+ group mirror_user
+ mode '0755'
+ recursive true
+ end
+ }
+
+ link local_path do
+ to actual_repo_path
+ end
+
+ resources(:remote_file => local_gpgkey_path) rescue remote_file local_gpgkey_path do
+ source repo['gpgkey']
+ owner mirror_user
+ group mirror_user
+ mode '0644'
+ end
+
+ reposync_sources.push(
+ {
+ 'id' => repo_id,
+ 'local_path' => local_path,
+ 'reposync_command' => "reposync -c #{yum_conf_path} -a #{arch} -r #{repo_id} -p #{local_parent_path}",
+ 'createrepo_command' => "createrepo #{local_path}"
+ }
+ )
+
+ ctx_path_elms= ctx_path.split('/')
+ gpgkey_ctx_path_elms = gpgkey_ctx_path.split('/')
+ if url_alias_with_authority_part then
+ url_aliases["/#{ctx_path_elms[0]}"] \
+ = "#{base_path}/mirror/#{ctx_path_elms[0]}"
+ url_aliases["/#{gpgkey_ctx_path_elms[0]}"] \
+ = "#{base_path}/mirror/#{gpgkey_ctx_path_elms[0]}"
+ else
+ url_aliases["/#{ctx_path_elms[1]}"] \
+ = "#{base_path}/mirror/#{ctx_path_elms[0]}/#{ctx_path_elms[1]}"
+ url_aliases["/#{gpgkey_ctx_path_elms[1]}"] \
+ = "#{base_path}/mirror/#{gpgkey_ctx_path_elms[0]}/#{gpgkey_ctx_path_elms[1]}"
+ end
+ }
+
+ return [reposync_sources, url_aliases]
+ end
end
end
#
::Chef::Recipe.send(:include, Commons::PackageUtils)
+::Chef::Recipe.send(:include, YumUtils::RepoUtils)
mirror_user = node['yum_utils']['mirror']['user']
base_path = node['yum_utils']['mirror']['base_path']
-resources(:group => mirror_user) rescue group mirror_user do
- system true
- action :create
-end
-
-resources(:user => mirror_user) rescue user mirror_user do
- gid mirror_user
- system true
- home base_path
- shell '/bin/sh'
- password nil
- action :create
-end
+create_mirror_user(mirror_user, base_path)
+create_mirror_dirs(mirror_user, base_path)
httpd_service = get_httpd_pkg_name
httpd_conf_path = nil
action :install
end
-[
- '',
- 'mirror',
- 'var',
-].each {|subdir|
- directory "#{base_path}/#{subdir}" do
- owner mirror_user
- group mirror_user
- mode '0755'
- recursive true
- end
-}
-
rsync_sources = []
node['yum_utils']['mirror']['rsync_sources'].each {|source|
local_path = "#{base_path}/mirror/#{source['url'].gsub(/^rsync:\/\//, '')}"
--- /dev/null
+#
+# Cookbook Name:: yum_utils
+# Recipe:: reposync_mirror
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+::Chef::Recipe.send(:include, Commons::PackageUtils)
+::Chef::Recipe.send(:include, YumUtils::RepoUtils)
+
+prefix = 'yum-reposync'
+yum_mirror = node['yum_utils']['reposync_mirror']
+
+reposync_sources, url_aliases = reposync_base_setup(
+ yum_mirror['user'],
+ yum_mirror['base_path'],
+ yum_mirror['yum_conf'],
+ yum_mirror['repos_dir'],
+ yum_mirror['repo_ids'],
+ yum_mirror['arch'],
+ yum_mirror['url_alias_with_authority_part']
+)
+
+template "/usr/local/bin/#{prefix}-mirror" do
+ source "usr/local/bin/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0755'
+ variables({
+ :reposync_sources => reposync_sources
+ })
+end
+
+pkg = get_cron_pkg_name
+resources(:package => pkg) rescue package pkg do
+ action :install
+end
+
+template "/etc/cron.d/#{prefix}-mirror" do
+ source "etc/cron.d/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0644'
+end
+
+httpd_service = get_httpd_pkg_name
+httpd_conf_path = nil
+
+case node[:platform_family]
+when 'debian'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror"
+when 'rhel'
+ httpd_conf_path = "/etc/#{httpd_service}/conf.d/#{prefix}-mirror.conf"
+end
+
+pkg = httpd_service
+resources(:package => pkg) rescue package pkg do
+ action :install
+end
+
+resources(:service => httpd_service) rescue service httpd_service do
+ action [:enable, :start]
+ supports :status => true, :restart => true, :reload => true
+end
+
+template httpd_conf_path do
+ source "etc/apache2/conf.d/#{prefix}-mirror"
+ owner 'root'
+ group 'root'
+ mode '0644'
+ variables({
+ :url_aliases => url_aliases
+ })
+ notifies :restart, "service[#{httpd_service}]"
+end
+
--- /dev/null
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%
+@url_aliases.each do |url_path, real_path|
+-%>
+Alias <%= url_path %> <%= real_path %>
+<Directory <%= real_path %>>
+ Options Indexes SymLinksIfOwnerMatch FollowSymLinks
+ IndexOptions NameWidth=* +SuppressDescription
+ AllowOverride FileInfo Indexes
+ Order Deny,Allow
+ Allow from all
+ ErrorDocument 404 default
+</Directory>
+
+<%
+end
+-%>
+
--- /dev/null
+#
+# Regular cron jobs for the yum-mirror
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%= node['yum_utils']['reposync_mirror']['cron_period'] %> <%= node['yum_utils']['reposync_mirror']['user'] %> /usr/local/bin/yum-reposync-mirror > <%= node['yum_utils']['reposync_mirror']['base_path'] %>/var/cron.log 2>&1
+
--- /dev/null
+#!/bin/sh
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<%
+@reposync_sources.each do |source|
+-%>
+echo -n 'Begin time: '; date
+<%= source['reposync_command'] %>
+<%= source['createrepo_command'] %>
+echo -n 'End time: '; date
+
+<%
+end
+-%>
+
--- /dev/null
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name 'cdh-mirror'
+description 'CDH mirror server.'
+
+run_list(
+ 'recipe[cdh::yum_mirror]',
+)
+
+#env_run_lists()
+
+default_attributes(
+)
+
+#override_attributes()
'role[node_commons]',
'role[apt-mirror]',
'role[apt-cacher-ng]',
- #'role[apt-source]',
+ 'role[apt-source]',
'role[yum-mirror]',
#'role[yum-repos]',
+ 'role[cdh-mirror]',
'role[yum-hdp]',
'role[hdp-mirror]',
'role[apache-mirror]',
=end
default_attributes(
+ 'cdh' => {
+ 'version' => '4.4.0',
+ 'yum_repo' => {
+ 'update' => true,
+ #'only_for_mirroring' => true,
+ #'mirroring' => {
+ # 'platform' => 'centos',
+ # 'platform_version' => '6'
+ #}
+ },
+ 'yum_mirror' => {
+ 'repo_ids' => [
+ 'cloudera-cdh4',
+ 'cloudera-gplextras4',
+ ],
+ 'arch' => 'x86_64',
+ 'url_alias_with_authority_part' => true
+ }
+ },
'hdp' => {
'version' => '1.3.2',
#'version' => '1.2.3.1',
'repo_ids' => [
'HDP-1.x',
'Updates-HDP-1.x',
- 'ambari-1.x'
- ]
+ 'HDP-UTILS-1.1.0.16',
+ 'ambari-1.x',
+ 'Updates-ambari-1.2.5.17'
+ ],
+ 'url_alias_with_authority_part' => true
}
}
)
'apt_utils' => {
'source' => {
'apt_lines' => [
- 'deb http://cdn.debian.net/debian wheezy main contrib non-free',
- 'deb http://cdn.debian.net/debian wheezy-updates main contrib',
- 'deb http://cdn.debian.net/debian wheezy-backports main contrib non-free',
+ #'deb http://cdn.debian.net/debian wheezy main contrib non-free',
+ #'deb http://cdn.debian.net/debian wheezy-updates main contrib',
+ #'deb http://cdn.debian.net/debian wheezy-backports main contrib non-free',
+ #'deb http://security.debian.org/ wheezy/updates main contrib non-free',
# self test
- #'deb http://localhost/debian wheezy main contrib non-free',
- #'deb http://localhost/debian wheezy-updates main contrib',
- #'deb http://localhost/debian wheezy-backports main contrib non-free',
+ 'deb http://ftp.grid.example.com/debian wheezy main contrib non-free',
+ 'deb http://ftp.grid.example.com/debian wheezy-updates main contrib',
+ 'deb http://ftp.grid.example.com/debian wheezy-backports main contrib non-free',
+ 'deb http://ftp.grid.example.com:3142/security.debian.org/ wheezy/updates main contrib non-free'
]
},
'mirror' => {
--- /dev/null
+#
+# Copyright 2013, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name 'yum-reposync-mirror'
+description 'YUM mirror server by reposync.'
+
+run_list(
+ 'recipe[yum_utils::reposync_mirror]',
+)
+
+#env_run_lists()
+
+default_attributes(
+)
+
+#override_attributes()