Skip to content

Commit

Permalink
fixes #2572 - FreeBSD unattended installation support via mfsbsd
Browse files Browse the repository at this point in the history
  • Loading branch information
endyman authored and Dominic Cleal committed Nov 28, 2013
1 parent ba402a7 commit acfb10f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/controllers/unattended_controller.rb
Expand Up @@ -224,6 +224,11 @@ def aif_attributes
@mediapath = os.mediumpath @host
end

def memdisk_attributes
os = @host.operatingsystem
@mediapath = os.mediumpath @host
end

def waik_attributes
end

Expand Down
3 changes: 2 additions & 1 deletion app/models/operatingsystem.rb
Expand Up @@ -50,7 +50,8 @@ class Operatingsystem < ActiveRecord::Base
'Windows' => %r{Windows}i,
'Archlinux' => %r{Archlinux}i,
'Gentoo' => %r{Gentoo}i,
'Solaris' => %r{Solaris}i }
'Solaris' => %r{Solaris}i,
'Freebsd' => %r{FreeBSD}i }

class Jail < Safemode::Jail
allow :name, :media_url, :major, :minor, :family, :to_s, :repos, :==, :release_name, :kernel, :initrd, :pxe_type, :medium_uri
Expand Down
38 changes: 38 additions & 0 deletions app/models/operatingsystems/freebsd.rb
@@ -0,0 +1,38 @@
class Freebsd < Operatingsystem
# We don't fetch any PXEFILES!
# Please copy your mfsbsd boot image into the tftp area.
#
# -as kernel we will use memdisk
# -as initrd we will use your custom FreeBSD-<arch>-<version>-mfs.img in boot
PXEFILES = {}

# Simple output of the media url
def mediumpath host
medium_uri(host).to_s
end

def class
Operatingsystem
end

def pxe_type
"memdisk"
end

def pxedir
"boot/$arch/images"
end

def url_for_boot(file)
pxedir + "/" + PXEFILES[file]
end

def kernel arch
"memdisk"
end

def initrd arch
"boot/FreeBSD-#{arch}-#{release}-mfs.img"
end
end

5 changes: 5 additions & 0 deletions app/views/unattended/snippets/_puppet.conf.erb
@@ -1,8 +1,13 @@
#kind: snippet
#name: puppet.conf
[main]
<% if @host.operatingsystem.name == "FreeBSD" -%>
vardir = /var/puppet
logdir = \$vardir/log
<% else -%>
vardir = /var/lib/puppet
logdir = /var/log/puppet
<% end -%>
rundir = /var/run/puppet
ssldir = \$vardir/ssl

Expand Down

0 comments on commit acfb10f

Please sign in to comment.