项目作者: benwtr

项目描述 :
将(hiera)YAML文件生成添加到kitchen-puppet,即puppet test-kitchen provisioner。
高级语言: Ruby
项目地址: git://github.com/benwtr/kitchen-puppet-hierawriter.git
创建时间: 2017-03-14T08:59:40Z
项目社区:https://github.com/benwtr/kitchen-puppet-hierawriter

开源协议:MIT License

下载


Kitchen Puppet Hierawriter

DEPRECATION NOTICE

This functionality has now been integrated upstream into kitchen-puppet
(https://github.com/neillturner/kitchen-puppet/commit/f858e0918a2c8c193b2e3697d7f25fa0507103b7).
Please use it instead. The gem will be yanked from Rubygems soon.

Description

Adds (hiera) YAML file generation
to kitchen-puppet,
the puppet test-kitchen
provisioner.

Allows creation of arbitrary YAML files in the target instance’s hieradata/
dir in test-kitchen configuration (eg kitchen.yml). Like setting chef
attributes in kitchen.yml, except for Hiera YAML files.

Currently only the puppet_apply provider from kitchen-puppet is supported.

Installation

Add this line to your puppet repo or module’s Gemfile:

  1. gem 'kitchen-puppet-hierawriter'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install kitchen-puppet-hierawriter

Usage

See kitchen-puppet’s documentation https://github.com/neillturner/kitchen-puppet

Once you have kitchen-puppet working, change the puppet_apply provisioner
to puppet_hierawriter_apply and set hiera_writer_files in kitchen.yml

  1. ---
  2. driver:
  3. name: vagrant
  4. provisioner:
  5. #name: puppet_apply
  6. name: puppet_hierawriter_apply
  7. manifests_path: /repository/puppet_repo/manifests
  8. modules_path: /repository/puppet_repo/modules-mycompany
  9. hiera_data_path: /repository/puppet_repo/hieradata
  10. hiera_writer_files:
  11. - datacenter/vagrant.yaml:
  12. logstash_servers: []
  13. hosts:
  14. 10.1.2.3:
  15. - puppet
  16. - puppetdb
  17. platforms:
  18. - name: nocm_ubuntu-12.04
  19. driver_plugin: vagrant
  20. driver_config:
  21. box: nocm_ubuntu-12.04
  22. box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
  23. suites:
  24. - name: default

The above configuration will result in the creation of a file on the guest named
${hieradata}/datacenter/vagrant.yaml containing:

  1. ---
  2. logstash_servers: []
  3. hosts:
  4. 10.1.2.3:
  5. - puppet
  6. - puppetdb

It will overwrite any existing Hiera YAML files with the same name (on the
guest), not merge.

Contributing

Bug reports and pull requests are welcome on GitHub at
https://github.com/benwtr/kitchen-puppet-hierawriter.

License

The gem is available as open source under the terms of
the MIT License.