Структура шаблонов конфигурации
Шаблон конфигурации может быть написан на языке yaml и загружен в систему Basis.
Загрузка шаблонов производится при помощи утилиты rsc-ba,
при помощи комманды :
rsc-ba configuration-template blueprint load /path_to_file/file.yml
Дополнительно шаблон может быть отредактирован в UI, при нажатии на нужный шаблон в списке (также могут быть добавлены/удалены/изменены переменные/параметры)
Пример шаблона(не рабочий шаблон)
# Everything is an object in CMDB
attributes: []
destructor: Common-Teardown # Specific blueprint which removes this blueprint from object
name: Common # Name of the template
parameters: # User defined parameters
- default: false
format: bool
name: Disable_Network_Manager
type: static
view: switch
profiles: # List of profiles which we create/update
- body:
ba::file: # Puppet module ba developed by RSC(in this case we are managing file contents)
NetworkManager.conf: # Name of resource inside Puppet
content: |- # Content which will be in the file (overwrite)
[main]
plugins=ifcfg-rh
dns=none
ensure: file # Makes puppet ensure that file exists
notify: # Notifying .service that its configuration has changed, making it restart
- Service[NetworkManager]
path: /etc/NetworkManager/NetworkManager.conf # FULL Path to the file
mode: "755"
ba::svc: # this case managing services
NetworkManager:
enable: $exec(`${NMenable}`) # $exec... - example of using user defined variables
ensure: $exec(`${NMensure}`)
ba::yumrepo: # this case adding repo
puppet:
baseurl: http://puppet.repo.service.consul/exmt/repo/puppet/
classes: # List of Puppet modules to apply, "ba" module applies as default
- basis3_sudo
- basis3_ssh
sysctl::base::values: # Puppet module from puppet forge https://forge.puppet.com/modules/thias/sysctl
kernel.msgmax:
value: 65536
name: puppet-common # name of the profiletype to be added to management object
type: hiera
vars: # list of user defined variables
globals: []
locals:
- body: $exec(`${Disable_Network_Manager}`== 'true' ? 'false':'true') # $exec... - evaluate variable value depend on parameter
mode: create
name: NMenable
- body: $exec(`${Disable_Network_Manager}`== 'true' ? 'stopped':'running')
mode: create
name: NMensure