Skip to content

Mirantis/host-os-modules

Repository files navigation

Host OS configuration ansible modules for MCC

This repository contains Ansible modules for Mirantis Container Cloud (MCC) that are released to customers.

Modules manage various system configurations through Ansible playbooks, adhering to specific schemas and metadata requirements.

TLDR

  1. Make changes to a module or introduce a new one
  2. Do not change version field of the metadata.yaml files manually
  3. make
  4. Commit changes
  5. Test the new CR
  6. make promote
  7. Commit changes

Module structure

Each module directory contains specific files crucial for the operation of the OS Modules.

The common structure within each module is as follows:

  • main.yaml: The primary playbook file that defines tasks to be executed.
  • metadata.yaml: Provides metadata about the module like name, version, and relevant documentation URLs.
  • schema.json: Defines the JSON schema for validating configurations specific to the module (i.e. restricted values).

Module index

Important - make sure to run make locally when updating modules, to keep index.yaml up to date.

Modules are indexed in index.yaml file that is stored in this repo. Before committing to gerrit, please run make to ensure fresh build and correct sha256 sums for module artifacts.

The directory .githooks contains Git hooks that can be used to enforce building modules and index.yaml.

Do not change metadata.yaml's version field manually, it will be changed automatically after running the make before committing.

Installing the Hooks

To install the hooks, run the following command:

cp ./.githooks/pre-commit ./.git/hooks

Available Hooks

pre-commit: runs make build tgz sort-index before committing changes and compares the output of the git diff command before and after.

Build

Requirements:

  • go
  • make
  • shasum

Modules and index.yaml are built using cmd/module-builder.go to ensure reproduceable tar.gz builds.

MCC implementation details

Modules are installed and controlled through two CRs in the management cluster:

Ansible module execution is implemented using the existing LCM mechanism, by creating an additional StateItem for mapped LCMMachines in MCC management cluster. For more implementation details, see (MOSK documentation)[https://docs.mirantis.com/mosk/latest/ops/bm-operations/host-os-conf/day2-intro.html].

Modules provided by MCC

Modules provided by MCC use the designated HostOSConfigurationModule object named mcc-modules. All other HostOSConfigurationModule objects contain custom modules.

Warning:: Do not modify the mcc-modules object, any changes will be overwritten with data from an external source.

Modules provided by MCC are described in this repository in their respective folders.

Release process

All modules and index.yaml are built per-commit by Jenkins using pipeline, that runs the Makefile in a container. Merged modules are then avaiable on internal artifactory and in master branch of artifact-metadata.

Use make promote to promote latest modules version in the repository, so new non-development versions are set for every module and all dev versions are removed from index.yaml.

In time for release, move artifact-metadata items to release branch to release them onto https://binary.mirantis.com/?prefix=bm/bin/host-os-modules/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published