Mirantis/environment-template

Name: environment-template

Owner: Mirantis Inc.

Description: null

Created: 2017-09-28 12:46:29.0

Updated: 2017-11-22 17:10:32.0

Pushed: 2018-01-11 12:26:00.0

Homepage: null

Size: 59

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

environment-template

Contribute

Please send patches using gerrithub.io:

remote add gerrit ssh://review.gerrithub.io:29418/Mirantis/environment-template.git
review
Render the template

Use reclass_tools from [1] to render the template:

ualenv venv-reclass
nv-reclass/bin/activate
install git+http://github.com/dis-xcom/reclass-tools

: any name for newly created environment model : path to the directory with the cookiecutter template, for example 'tcp-qa/tcp_tests/environment/environment_template' : path to directory where will be created the new environment model : path to the YAML with the inventory data. Can be specified multiple times to use different parts of the inventory. VCP inventory must be specified for current workflow (when all linux.network.interface are deleted)

ass-tools render -e <env_name> -t <path_to_template> -o <destination_path> -c <inventory_file1> -c <inventory_file2> [...] -c <inventory_fileN>

To attach the environment model to any cluster, use the instructions from [1]

[1] https://github.com/dis-xcom/reclass_tools

Template architecture
environment_template
??? {{ cookiecutter._env_name }}
?   ??? init.yml
?   ??? linux_network_interface.yml
?   ??? linux_system_codename_trusty.yml
?   ??? linux_system_codename_xenial.yml
?   ??? {# interfaces #} -> ../{# interfaces #}
?   ??? {# roles #} -> ../{# roles #}
??? {# interfaces #}
?   ??? ...
??? {# roles #}
    ??? ...

In the init.yml is defined a dict variable 'params' that is accessible from files in {# interfaces #} and {# roles #}. 'params' may be used by Jinja expressions in these folders to generate some additional dynamic 'parameters:_param' pillars that cannot be specified as a fixed value in a class.

If you need to specify a fixed values, please do the following:

Inventory examples

Inventory must include all the nodes, physical or virtual. 'reclass_storage_name' is used for back compatibility until some parameters are still inherited from the cluster/system level of the reclass:storage pillars.

Physical node example:

s:
kvm01.mcp11-ovs-dpdk.local:
  reclass_storage_name: infra_kvm_node01
  roles:
  - infra_kvm
  - linux_system_codename_xenial
  interfaces:
    enp3s0f0:
      role: single_mgm
    enp3s0f1:
      role: bond0_ab_nondvr_vxlan_ctl_mesh

Virtual Control Plane node example:

s:
ctl01.mcp11-ovs-dpdk.local:
  reclass_storage_name: openstack_control_node01
  roles:
  - openstack_control_leader
  - linux_system_codename_xenial
  interfaces:
    ens3:
      role: single_ctl

Override addresses example:

s:
gtw01.mcp11-ovs-dpdk.local:
  reclass_storage_name: openstack_control_node01
  roles:
  - openstack_gateway
  - linux_system_codename_xenial
  interfaces:
    enp3s0f0:
      role: single_mgm
      deploy_address: 1.1.1.10
      deploy_network_netmask: 255.255.252.0
      deploy_network_gateway: 1.1.1.1
    enp3s0f1:
      role: single_ctl
      single_address: 2.2.2.2
      control_network_netmask: 255.255.255.0
    enp8s0f0:
      role: bond1_ab_ovs_floating
    enp8s0f1:
      role: bond1_ab_ovs_floating
TODO

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.