OSDN Git Service

update apt_utils::mirror recipe.
[metasearch/grid-chef-repo.git] / roles / grid-ftp.rb
1 $LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
2 #${chef-repo}/_lib/grid.rb
3 require 'grid'
4
5 name 'grid-ftp'
6 description 'Grid distribution node'
7
8 run_list(
9   'role[node_commons]',
10   'role[apt-mirror]',
11   'role[apt-source]',
12   #'role[ganglia-gmond]',
13 )
14
15 #env_run_lists()
16
17 this_subcluster = Grid::CLUSTERS[:base][:admins]
18 mcast_addr = this_subcluster[:mcast_addr]
19 port = '8649'
20 =begin
21 # uni-cast
22 udp_send_channels4ucast = []
23 this_subcluster[:nodes].first(2).each {|host|
24   udp_send_channels4ucast.push(
25     {
26       'mcast_join' => '',
27       'host' => "#{host}.#{Grid::DOMAIN}",
28       'port' => port,
29       'ttl' => ''
30     }
31   )
32 }
33 =end
34
35 default_attributes(
36 )
37
38 override_attributes(
39   'apt_utils' => {
40     'source' => {
41       'apt_lines' => [
42         'deb http://cdn.debian.net/debian wheezy main contrib non-free',
43         'deb http://cdn.debian.net/debian wheezy-updates main contrib',
44         'deb http://cdn.debian.net/debian wheezy-backports main contrib non-free',
45         'deb http://localhost/debian wheezy main contrib non-free',
46         'deb http://localhost/debian wheezy-updates main contrib',
47         'deb http://localhost/debian wheezy-backports main contrib non-free',
48       ]
49     },
50     'mirror' => {
51       'cron_period' => '0 22   * * *',
52       #'cron_period' => '0 4   * * *',
53       'country' => 'jp',
54       'distributions' => {
55         'debian' => {
56           'code_names' => [
57             'wheezy',
58             'wheezy-updates',
59             'wheezy-backports',
60           ],
61           'architectures' => [
62             'amd64',
63             'i386'
64             #'src',
65           ],
66           'components' => [
67             'main',
68             'contrib',
69             'non-free'
70           ]
71         }
72       },
73     },
74   },
75   'ganglia' => {
76     # gmond
77     'cluster' => {
78       'name' => this_subcluster[:alias],
79       'owner' => Grid::DOMAIN
80     },
81     ## static multi-cast
82     'static' => {
83       'udp_send_channels' => [
84         {
85           'mcast_join' => mcast_addr,
86           'host' => '',
87           'port' => port,
88           'ttl' => '1'
89         }
90       ],
91       'udp_recv_channels' => [
92         {
93           'mcast_join' => mcast_addr,
94           'port' => port,
95           'bind' => mcast_addr
96         }
97       ]
98 =begin
99       ## static uni-cast
100       'udp_send_channels' => udp_send_channels4ucast,
101       'udp_recv_channels' => [
102         {
103           'mcast_join' => '',
104           'port' => port,
105           'bind' => ''
106         }
107       ]
108 =end
109     }
110   }
111 )