RedHatOfficial / miq-Utilities

ManageIQ Automate Domain of shared utilities to be used by other ManageIQ domains developed by Red Hat Consulting.
GNU General Public License v3.0
18 stars 17 forks source link
cfme cloudforms manageiq manageiq-domains miq redhat redhatconsulting rhc ruby

miq-Utilities

ManageIQ Automate Domain of shared utilities to be used by other ManageIQ domains.

Table of Contents

Features

The high level features of this ManageIQ extension.

Automate

Information on the provided Automate.

ManageIQ Overrides

Instances where this domain overrides defaults provided in ManageIQ

Automate StdLib

This namespace serves as a "standard library" of CloudForms (ManageIQ) Automation code. The goal is for common methods to be collected here, and to be suitbale for inclusion as "Embedded Methods".

See: https://cloudformsblog.redhat.com/2018/04/17/embedded-methods/ for conceptual background.

Automate Settings

This project now includes a new mechanism for storing and accessing configuration settings. This has some advantages over traditional processes for configuration (instance variables or constants within a method). The settings can all be stored in one location, and being code, edited in something more featureful than a text box. The settings values can be any ruby data structure directly, and do not require juggling between yaml or json as commonly happens. Additionally, as the settings are grouped into global/default/region, then one can configure common and region-specific settings in a single place, for multi region deployments, useful for either a replication setup, or a dev/prod envionment split, pulling code from one git source.

/StdLib/Settings/settings provides the core lookup functionality. /StdLib/Settings/settingsstore holds setting values.

Settings over multiple Domains

To leverage your own custom settings, one can simply copy settings.rb up to a top priority domain, and edit it per norm. However, to isolate out ones own domain's settings, there is a mechanism ot merge in settings from different files.

Using the commented code in settings.rb as a template, create a new (ruby) class that extends RedHatConsulting_Utilities::StdLib::Core::Settings and has a PRIORITY and SETTINGS class values.

Copy our settings.rb to a high priority domain. Configure it to have embedded methods of all other settings.rb you wish to include (but not the one from this project). Ordered inclusion is impossible to guarantee with the UX currently, the PRIORITY setting, however, is honoured in merging the hashes. In practice, you are going to want to use non-overlapping key values, or manually reconcile the desired values in the settings.rb in the high priority domain.

Provision Dialogs

Install

  1. Install dependencies
  2. Automate -> Import/Export
  3. Import Datastore via git
  4. Git URL: https://github.com/rhtconsulting/miq-Utilities.git
  5. Submit
  6. Select Branch/Tag to synchronize with
  7. Submit

Unit Testing

To run the test suite, you first require a functional ManageIQ development environment, specifically, able to run the test suite of https://github.com/ManageIQ/manageiq-content/ . Link in this project to that, per

manageiq-content/content/automate/RedHatConsulting_Utilities -> miq-Utilities/Automate/RedHatConsulting_Utilities manageiq-content/spec/content/automate/RedHatConsulting_Utilities -> miq-Utilities/UnitTests/spec/content/RedHatConsulting_Utilities manageiq-content/spec/factories/RedHatConsulting_Utilities -> miq-Utilities/UnitTests/spec/factories/RedHatConsulting_Utilities

and then run $ bundle exec rake or, e.g., $ bundle exec rspec --format documentation --pattern spec/content/automate/RedHatConsulting_Utilities/*/_spec.rb

Branches and Tags

The master branch of this repository will aim to support the current CloudForms release. If breaking changes for previous CloudForms versions are introduced in Master, version specific branches and tags will be created for those previous versions, as long as those releases are still supported by Red Hat. The version-specific release branches will be no longer be maintained once that version of CloudForms is end of life.

CloudForms Product Lifecycle Information:

Contributors

https://github.com/RedHatOfficial/miq-Utilities/graphs/contributors