environmint-model-utils

Copyright 2014 © LimePoint Pty Ltd. All rights reserved.

This gem provides services for richer environmint configurations - in particular, introspections, overlay rules, and scaleout. The correct sequence for these is:

  • scaleout

  • apply_businessrules

  • resolve_introspections

Of course, if you only want introspections, you can just call the latter and ignore the former - but you should never call them out of order, because the scaleout system particularly relies on you later resolving the introspections.

Usage

Model Object Mode:

require ‘environmint-model-utils’ include EnvironMintModelUtils

model=MintModel.new(json_data)
model.resolve!

# You can filter by adding item: match
model.installations(product: 'jdk').each do |i|
  p i.name
  p i.installPath
  p i.version
end

# You can use convention based lookups as in introspections
model.domains(name: '*soa*').each do |d|
  p d.name
  p d.adminServer.machine.nodemanager.name
  p d.adminServer.machine.nodemanager.host.id
  p d.repositories.db.name
end

model.nodeManagers.each do |n|
  p n.name
  p n.installation.name
end

Standard Mode:

require 'environmint-model-utils'
include EnvironMintModelUtils

# Resolve all introspections and lookups in a json file, giving a flat file
# Note that fulldata is only required if you're not passing an entire tree 
resolve_introspections!(jdata, fulldata: nil)

# Scaleup a node - see README.scaleout.md for the semantics of how it works, but the simple case is:
#
# jsondata - the model
# nodes - number of nodes to scale out to
# nodesperhost - number of nodes on each host
# 
# Both of these can be a hash of sets of [servername, number]
# { "*" => 2, "soa_server*" => 1 }
# longest match wins
# 
# port_increment - boolean to switch whether we increment the server port on each host or not
# seperate_admin - boolean to switch whether we seperate the admin server onto a different host
# host_list - A list of hostnames to scaleout on to.  If this is set to nil or empty list, the system will
#             attempt to create numbered hosts for you
# dedicated_admin_node - When seperating the admin, do we create a server named 'xxxAdmin' or put it on server #1
# node_filter - list of nodes to build.  For example, if passed [1,2,6,7] it will build nodes 1, 2, 6, and 7 only

scaleout!(jsondata, nodes, nodesperhost, port_increment, seperate_admin, host_list, dedicated_admin_node: false, node_filter: nil)

# Execute the businessrules engine on this model, using the list specs as input - see README.businessrules.md for details on this
apply_businessrules(jsondata, specs, platform)

# Update a model to use a remote software stage, rather than a locally mounted one
convert_to_remote_stage!(jdata)

License & Authors

# MintPress® - Automation and Configuration Management Platform
# Copyright © 2018 LimePoint. All rights reserved.
#
# This program and its contents are confidential and owned by LimePoint.
# Only licenced users are permitted to access and use of this file.
# This program (or any part of it) may not be disclosed, copied or used
# except as expressly permitted in LimePoint’s End User Licence Agreement.
#
# LimePoint® and MintPress® are Registered Trademarks of LimePoint
# For more information contact LimePoint at [http://www.limepoint.com]