summaryrefslogtreecommitdiffstats
path: root/contrib/ruby/lib/cobbler.rb
blob: e4fe0c57d3efb1aa651bb41085a2c4f9828d8746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# cobbler.rb - Cobbler module declaration.
# 
# Copyright (C) 2008 Red Hat, Inc.
# Written by Darryl L. Pierce <dpierce@redhat.com>
#
# This file is part of rubygem-cobbler.
#
# rubygem-cobbleris free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published 
# by the Free Software Foundation, either version 2.1 of the License, or
# (at your option) any later version.
#
# rubygem-cobbler is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with rubygem-cobbler.  If not, see <http://www.gnu.org/licenses/>.
#
 
require 'cobbler/base'
require 'cobbler/distro'
require 'cobbler/image'
require 'cobbler/network_interface'
require 'cobbler/profile'
require 'cobbler/system'
 
module Cobbler      
  config = (ENV['COBBLER_YML'] || File.expand_path("config/cobbler.yml"))
      
  yml = YAML::load(File.open(config)) if File.exist?(config)
      
  if yml
    Base.hostname = yml['hostname']
    Base.username = yml['username']
    Base.password = yml['password']
  end
    
end