Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2572 basic FreeBSD support #956

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/unattended_controller.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions app/views/unattended/snippets/_puppet.conf.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#kind: snippet
#name: puppet.conf
[main]
<% if @host.operatingsystem.name == "FreeBSD" -%>vardir = /var/puppet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you added the -%> I think you can do it in two seperate lines...

besides that, @domcleal any concern about puppet.conf changes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

logdir = \$vardir/log
<% else -%>
vardir = /var/lib/puppet
logdir = /var/log/puppet
<% end -%>
rundir = /var/run/puppet
ssldir = \$vardir/ssl

Expand Down