OSDN Git Service

fix service control.
[metasearch/grid-chef-repo.git] / roles / grid-ftp.rb
index 8d8e874..ba4840b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2013, whitestar
+# Copyright 2013,2014 whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
 # limitations under the License.
 #
 
-$LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
-#${chef-repo}/_lib/grid.rb
+$LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
+#${chef-repo}/roles/_lib/grid.rb
 require 'grid'
 
 name 'grid-ftp'
@@ -24,8 +24,15 @@ description 'Grid distribution node'
 run_list(
   'role[node_commons]',
   'role[apt-mirror]',
+  'role[apt-cacher-ng]',
   'role[apt-source]',
   'role[yum-mirror]',
+  #'role[yum-repos]',
+  'role[yum-cdh]',
+  'role[cdh-mirror]',
+  'role[yum-hdp]',
+  'role[hdp-mirror]',
+  'role[apache-mirror]',
   #'role[ganglia-gmond]',
 )
 
@@ -53,20 +60,27 @@ default_attributes(
 )
 
 override_attributes(
+  'apache_utils' => {
+    'mirror' => {
+      'cron_period' => '5 23   * * *'
+    }
+  },
   '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://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://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://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' => {
-      'cron_period' => '0 22   * * *',
-      #'cron_period' => '0 4   * * *',
+      'cron_period' => '5 22   * * *',
       'country' => 'jp',
       'distributions' => {
         'debian' => {
@@ -74,6 +88,9 @@ override_attributes(
             'wheezy',
             'wheezy-updates',
             'wheezy-backports',
+            'squeeze',
+            'squeeze-updates',
+            'squeeze-backports',
           ],
           'architectures' => [
             'amd64',
@@ -89,19 +106,88 @@ override_attributes(
       }
     }
   },
+  'cdh' => {
+    'version' => '4.4.0',
+    'yum_repo' => {
+      'with_gplextras' => true,
+      'update' => true,
+      'only_for_mirroring' => true,
+      'mirroring' => {
+        'platform' => 'centos',
+        'platform_version' => '6',
+        'arch' => 'x86_64'
+      }
+    },
+    'yum_mirror' => {
+      'cron_period' => '5 20   * * *',
+      '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',
+    'yum_repo' => {
+      'update' => true,
+      'only_for_mirroring' => true,
+      'mirroring' => {
+        'platform' => 'centos',
+        'platform_version' => '6'
+      }
+    },
+    'yum_mirror' => {
+      'cron_period' => '35 20   * * *',
+      'repo_ids' => [
+        'HDP-1.x',
+        'Updates-HDP-1.x',
+        'HDP-UTILS-1.1.0.16',
+        'ambari-1.x',
+        'Updates-ambari-1.2.5.17'
+      ],
+      'url_alias_with_authority_part' => true
+    }
+  },
   'yum_utils' => {
+    'repos' => {
+      'CentOS-Base' => {
+        'mirrorlist_ctx' => '', # default: inactive
+        #'mirrorlist_ctx' => 'http://mirrorlist.centos.org',
+        'baseurl_ctx' => '',  # default: inactive
+        #'baseurl_ctx' => 'http://mirror.centos.org/centos',
+        #'baseurl_ctx' => 'http://ftp.grid.example.com/centos',
+        'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6'
+      },   
+      'epel' => {
+        'mirrorlist_ctx' => '', # default: inactive
+        #'mirrorlist_ctx' => 'http://mirrors.fedoraproject.org',
+        'baseurl_ctx' => '',  # default: inactive
+        #'baseurl_ctx' => 'http://ftp.grid.example.com/fedora/epel',
+        'gpgkey' => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6'
+      }
+    },
     'mirror' => {
-      'cron_period' => '0 21   * * *',
-      #'cron_period' => '0 4   * * *',
+      'cron_period' => '5 21   * * *',
       'rsync_sources' => [
         {
+          # CentOS
           'url' => 'rsync://ftp.riken.jp/centos/',
-          'rsync_opts' => '-avSH --stats --partial --delete --exclude /[1-5]*/ --exclude /6.[0-3]/ --exclude local* --exclude isos --exclude ppc*',
+          # 5.9 or later
+          'rsync_opts' => '-avSH --stats --partial --delete --safe-links --exclude /[1-4]*/ --exclude /5.[0-8]/ --exclude /6.[0-3]/ --exclude local* --exclude isos --exclude ppc*',
+          # 6.4 or later
+          #'rsync_opts' => '-avSH --stats --partial --delete --safe-links --exclude /[1-5]*/ --exclude /6.[0-3]/ --exclude local* --exclude isos --exclude ppc*',
           'http_alias' => '/centos'
         },
         {
+          # EPEL
           'url' => 'rsync://ftp.riken.jp/fedora/epel/',
-          'rsync_opts' => '-avSH --stats --partial --delete --exclude /[1-5]*/ --exclude local* --exclude isos --exclude ppc*',
+          # 5 or later
+          'rsync_opts' => '-avSH --stats --partial --delete --safe-links --exclude /[1-4]*/ --exclude local* --exclude isos --exclude ppc*',
+          # 6 or later
+          #'rsync_opts' => '-avSH --stats --partial --delete --safe-links --exclude /[1-5]*/ --exclude local* --exclude isos --exclude ppc*',
           'http_alias' => '/fedora/epel'
         }
       ]