]> git.openstreetmap.org Git - chef.git/blob - roles/ironbelly.rb
Simplify named configuration
[chef.git] / roles / ironbelly.rb
1 name "ironbelly"
2 description "Master role applied to ironbelly"
3
4 default_attributes(
5   :dhcpd => {
6     :first_address => "10.0.63.1",
7     :last_address => "10.0.63.254"
8   },
9   :elasticsearch => {
10     :cluster => {
11       :routing => {
12         :allocation => {
13           :disk => {
14             :watermark => {
15               :low => "95%",
16               :high => "98%",
17               :flood_stage => "99%"
18             }
19           }
20         }
21       }
22     },
23     :path => {
24       :data => "/store/elasticsearch"
25     }
26   },
27   :networking => {
28     :interfaces => {
29       :internal_ipv4 => {
30         :interface => "bond0",
31         :role => :internal,
32         :family => :inet,
33         :address => "10.0.48.10",
34         :bond => {
35           :mode => "802.3ad",
36           :lacprate => "fast",
37           :xmithashpolicy => "layer3+4",
38           :slaves => %w[eth0 eth1]
39         }
40       },
41       :external_ipv4 => {
42         :interface => "bond0.2",
43         :role => :external,
44         :family => :inet,
45         :address => "130.117.76.10"
46       },
47       :external_ipv6 => {
48         :interface => "bond0.2",
49         :role => :external,
50         :family => :inet6,
51         :address => "2001:978:2:2C::172:A"
52       }
53     }
54   },
55   :prometheus => {
56     :snmp => {
57       "pdu1" => { :address => "10.0.48.100", :modules => %w[apcups], :labels => { "site" => "amsterdam" } },
58       "pdu2" => { :address => "10.0.48.101", :modules => %w[apcups], :labels => { "site" => "amsterdam" } },
59       "switch1" => { :address => "130.117.76.2", :modules => %w[if_mib juniper_ex4300], :labels => { "site" => "amsterdam" } }
60     },
61     :metrics => {
62       :uplink_interface => {
63         :help => "Site uplink interface name",
64         :labels => { :site => "amsterdam", :name => "ge-[01]/2/0" }
65       }
66     }
67   },
68   :rsyncd => {
69     :modules => {
70       :logs => {
71         :comment => "Log files",
72         :path => "/store/logs",
73         :read_only => false,
74         :write_only => true,
75         :list => false,
76         :uid => "www-data",
77         :gid => "www-data",
78         :transfer_logging => false,
79         :hosts_allow => [
80           "193.60.236.0/24",          # ucl external
81           "10.0.48.0/20",             # amsterdam internal
82           "130.117.76.0/27",          # amsterdam external
83           "2001:978:2:2C::172:0/112", # amsterdam external
84           "10.0.64.0/20",             # dublin internal
85           "184.104.226.96/27",        # dublin external
86           "2001:470:1:b3b::/64",      # dublin external
87           "10.0.32.0/20",             # bytemark internal
88           "89.16.162.16/28",          # bytemark external
89           "2001:41c9:2:d6::/64",      # bytemark external
90           "127.0.0.0/8",              # localhost
91           "::1"                       # localhost
92         ]
93       }
94     }
95   }
96 )
97
98 run_list(
99   "role[equinix-ams]",
100   "role[gateway]",
101   "role[supybot]",
102   "recipe[rsyncd]",
103   "recipe[dhcpd]"
104 )