Project

General

Profile

« Previous | Next » 

Revision 611f5bff

Added by Amos Benari over 11 years ago

  • ID 611f5bff49c1f06ae9ad0dd42b7566df9a02af2f

Add organization and location to foreman.

This feature allows foreman to provide multi location, multi tenant and
multi organizations capablities.

the idea is that resources within foreman (e.g. hosts, subnets, users,
environments etc) can belong to one or more locations and organization,
effectivily hidding resources from users.

Organization may contain multiple locations, and Locations can belong
to multiple Organization, this is an extermily flexiable design,
however, it is up to the user to allocate the resources across the
organizations and locations.

When creating new hosts, the resources that can be consumed are only
resources in which exists in both the currently used organization and location.

fixes #1578
fixes #1593

View differences:

app/views/media/_form.html.erb
<%= javascript "nfs_visibility" %>
<%= form_for @medium do |f| %>
<%= base_errors_for @medium %>
<%= text_f f, :name %>
<%= text_f f, :path, :class => "input-xxlarge", :help_block => "The path to the medium, can be a URL or a valid NFS server (exclusive of the architecture).
for example <em>http://mirror.averse.net/centos/$version/os/$arch</em> where <strong>$arch</strong> will be substituted for the host's actual OS architecture and <strong>$version</strong>, <strong>$major</strong> and <strong>$minor</strong> will be substituted for the version of the operating system. Solaris and Debian media may also use <strong>$release</strong>.".html_safe %>
<span id="nfs-section" <%= display?(!@medium.operatingsystems.map(&:require_nfs_access_to_medium).any?) %>>
<%= text_f f, :media_path, :class => "input-xxlarge", :help_inline => "The NFS path to the media." %>
<%= text_f f, :config_path, :class => "input-xxlarge", :help_inline => "The NFS path to the jumpstart control files." %>
<%= text_f f, :image_path, :class => "input-xxlarge", :help_inline => "The NFS path to the image directory." %>
</span>
<%= selectable_f f, :os_family, Operatingsystem.families, { :include_blank => true }, { :label => "Operating System Family" } %>
<%= submit_or_cancel f %>
<% end %>
<% if show_taxonomy_tabs? %>
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a href="#primary" data-toggle="tab">Medium</a></li>
<% if show_location_tab? %>
<li><a href="#locations" data-toggle="tab">Locations</a></li>
<% end %>
<% if show_organization_tab? %>
<li><a href="#organizations" data-toggle="tab">Organizations</a></li>
<% end %>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="primary">
<% end%>
<%= text_f f, :name %>
<%= text_f f, :path, :class => "input-xxlarge", :help_block => "The path to the medium, can be a URL or a valid NFS server (exclusive of the architecture).
for example <em>http://mirror.averse.net/centos/$version/os/$arch</em> where <strong>$arch</strong> will be substituted for the host's actual OS architecture and <strong>$version</strong>, <strong>$major</strong> and <strong>$minor</strong> will be substituted for the version of the operating system. Solaris and Debian media may also use <strong>$release</strong>.".html_safe %>
<span id="nfs-section" <%= display?(!@medium.operatingsystems.map(&:require_nfs_access_to_medium).any?) %>>
<%= text_f f, :media_path, :class => "input-xxlarge", :help_inline => "The NFS path to the media." %>
<%= text_f f, :config_path, :class => "input-xxlarge", :help_inline => "The NFS path to the jumpstart control files." %>
<%= text_f f, :image_path, :class => "input-xxlarge", :help_inline => "The NFS path to the image directory." %>
</span>
<%= selectable_f f, :os_family, Operatingsystem.families, { :include_blank => true }, { :label => "Operating System Family" } %>
</div>
<% if show_taxonomy_tabs? %>
<% if show_location_tab? %>
<div class="tab-pane" id="locations">
<%= multiple_checkboxes f, :locations, @medium, Location %>
</div>
<% end %>
<% if show_organization_tab? %>
<div class="tab-pane" id="organizations">
<%= multiple_checkboxes f, :organizations, @medium, Organization %>
</div>
<% end %>
<% end %>
<%= submit_or_cancel f %>
</div>
<% end %>
<script type="text/javascript" charset="utf-8">
nfs_section_visibility([<%= Operatingsystem.all.map(&:require_nfs_access_to_medium).join(", ") %>])
</script>

Also available in: Unified diff