beaker-hiera 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +22 -0
- data/.github/workflows/test.yml +27 -0
- data/Gemfile +1 -1
- data/HISTORY.md +5 -0
- data/README.md +12 -4
- data/Rakefile +3 -3
- data/beaker-hiera.gemspec +15 -18
- data/bin/beaker-hiera +3 -5
- data/lib/beaker-hiera.rb +2 -11
- data/lib/beaker-hiera/helpers.rb +33 -21
- data/lib/beaker-hiera/version.rb +2 -1
- data/spec/beaker-hiera/helpers_spec.rb +28 -56
- data/spec/spec_helper.rb +4 -7
- metadata +25 -52
- data/spec/beaker_test_helpers.rb +0 -18
- data/spec/helpers.rb +0 -109
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3f452d3f2513e4aba4d980f029222044b4f899d92c68ae02f71f8c25bbfd531a
         | 
| 4 | 
            +
              data.tar.gz: b03bc1cf07161dbe89c7915c7b3f489a7f37b471aee548f8d26438a39e9bb46f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 17e9609cbf693def9d87ecfb7c51df255a143cbdbf3e03dd791b5cd44520d6861495d06c4292403c9240391aba7ddaeb3dafc696b6b5c570e65e359fad18e000
         | 
| 7 | 
            +
              data.tar.gz: 8bfb95f9b8331d10c3185760425668898ab445c46889ddf8e4b857f2149e6d5973ae3e686859bb2d7544e81496b257525fbfa1e0ee79a54426110dc30f062874
         | 
| @@ -0,0 +1,22 @@ | |
| 1 | 
            +
            name: Release
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            on:
         | 
| 4 | 
            +
              create:
         | 
| 5 | 
            +
                ref_type: tag
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            jobs:
         | 
| 8 | 
            +
              release:
         | 
| 9 | 
            +
                runs-on: ubuntu-latest
         | 
| 10 | 
            +
                if: github.repository == 'voxpupuli/beaker-hiera'
         | 
| 11 | 
            +
                steps:
         | 
| 12 | 
            +
                  - uses: actions/checkout@v2
         | 
| 13 | 
            +
                  - name: Install Ruby 2.7
         | 
| 14 | 
            +
                    uses: ruby/setup-ruby@v1
         | 
| 15 | 
            +
                    with:
         | 
| 16 | 
            +
                      ruby-version: '2.7'
         | 
| 17 | 
            +
                  - name: Build gem
         | 
| 18 | 
            +
                    run: gem build *.gemspec
         | 
| 19 | 
            +
                  - name: Publish gem
         | 
| 20 | 
            +
                    run: gem push *.gem
         | 
| 21 | 
            +
                    env:
         | 
| 22 | 
            +
                      GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            name: Test
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            on:
         | 
| 4 | 
            +
              - pull_request
         | 
| 5 | 
            +
              - push
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            jobs:
         | 
| 8 | 
            +
              test:
         | 
| 9 | 
            +
                runs-on: ubuntu-latest
         | 
| 10 | 
            +
                strategy:
         | 
| 11 | 
            +
                  fail-fast: false
         | 
| 12 | 
            +
                  matrix:
         | 
| 13 | 
            +
                    ruby:
         | 
| 14 | 
            +
                      - "2.4"
         | 
| 15 | 
            +
                      - "2.5"
         | 
| 16 | 
            +
                      - "2.6"
         | 
| 17 | 
            +
                      - "2.7"
         | 
| 18 | 
            +
                name: Ruby ${{ matrix.ruby }}
         | 
| 19 | 
            +
                steps:
         | 
| 20 | 
            +
                  - uses: actions/checkout@v2
         | 
| 21 | 
            +
                  - name: Install Ruby ${{ matrix.ruby }}
         | 
| 22 | 
            +
                    uses: ruby/setup-ruby@v1
         | 
| 23 | 
            +
                    with:
         | 
| 24 | 
            +
                      ruby-version: ${{ matrix.ruby }}
         | 
| 25 | 
            +
                      bundler-cache: true
         | 
| 26 | 
            +
                  - name: Run tests
         | 
| 27 | 
            +
                    run: bundle exec rake test
         | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/HISTORY.md
    CHANGED
    
    | @@ -1,11 +1,16 @@ | |
| 1 1 | 
             
            # default - History
         | 
| 2 2 | 
             
            ## Tags
         | 
| 3 | 
            +
            * [0.3.0 - 18 May, 2021](#0.2.1)
         | 
| 3 4 | 
             
            * [0.2.0 - 10 Nov, 2020](#0.2.0)
         | 
| 4 5 | 
             
            * [0.1.1 - 14 Oct, 2.05 (a23d45bc)](#0.1.1)
         | 
| 5 6 | 
             
            * [0.1.0 - 8 Sep, 2.05 (7d1ef9b6)](#0.1.0)
         | 
| 6 7 |  | 
| 7 8 | 
             
            ## Details
         | 
| 8 9 |  | 
| 10 | 
            +
            ### <a name = "0.3.0">0.3.0 - 18 May, 2021
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            * Major update to work with Beaker 4
         | 
| 13 | 
            +
             | 
| 9 14 | 
             
            ### <a name = "0.2.0">0.2.0 - 10 Nov, 2020
         | 
| 10 15 |  | 
| 11 16 | 
             
            * Release before moving to Vox Pupuli
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,6 +1,14 @@ | |
| 1 | 
            -
            #  | 
| 1 | 
            +
            # beaker-hiera
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 3 | 
            +
            Beaker Hiera DSL Extension Library! This allows to easily use Hiera data in acceptance tests.
         | 
| 4 4 |  | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 5 | 
            +
            ```ruby
         | 
| 6 | 
            +
            hierarchy = [
         | 
| 7 | 
            +
              'fqdn/%{fqdn}.yaml',
         | 
| 8 | 
            +
              'os/%{os.family}/%{os.release.major}.yaml',
         | 
| 9 | 
            +
              'os/%{os.family}.yaml',
         | 
| 10 | 
            +
              'common.yaml',
         | 
| 11 | 
            +
            ]
         | 
| 12 | 
            +
            write_hiera_config_on(host, hierarchy)
         | 
| 13 | 
            +
            copy_hiera_data_to(host, 'spec/acceptance/hieradata')
         | 
| 14 | 
            +
            ```
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -1,16 +1,16 @@ | |
| 1 1 | 
             
            require 'rspec/core/rake_task'
         | 
| 2 2 |  | 
| 3 | 
            -
            desc  | 
| 3 | 
            +
            desc 'Run spec tests'
         | 
| 4 4 | 
             
            RSpec::Core::RakeTask.new(:test) do |t|
         | 
| 5 5 | 
             
              t.rspec_opts = ['--color']
         | 
| 6 6 | 
             
              t.pattern = 'spec/'
         | 
| 7 7 | 
             
            end
         | 
| 8 8 |  | 
| 9 | 
            -
            desc  | 
| 9 | 
            +
            desc 'Run spec tests with coverage'
         | 
| 10 10 | 
             
            RSpec::Core::RakeTask.new(:coverage) do |t|
         | 
| 11 11 | 
             
              ENV['BEAKER_HIERA_COVERAGE'] = 'y'
         | 
| 12 12 | 
             
              t.rspec_opts = ['--color']
         | 
| 13 13 | 
             
              t.pattern = 'spec/'
         | 
| 14 14 | 
             
            end
         | 
| 15 15 |  | 
| 16 | 
            -
            task : | 
| 16 | 
            +
            task default: :test
         | 
    
        data/beaker-hiera.gemspec
    CHANGED
    
    | @@ -1,37 +1,34 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
         | 
| 1 | 
            +
            $LOAD_PATH.unshift File.expand_path('lib', __dir__)
         | 
| 3 2 | 
             
            require 'beaker-hiera/version'
         | 
| 4 3 |  | 
| 5 4 | 
             
            Gem::Specification.new do |s|
         | 
| 6 | 
            -
              s.name        =  | 
| 5 | 
            +
              s.name        = 'beaker-hiera'
         | 
| 7 6 | 
             
              s.version     = Beaker::DSL::Helpers::Hiera::Version::STRING
         | 
| 8 | 
            -
              s.authors     = [ | 
| 9 | 
            -
              s.email       = [ | 
| 10 | 
            -
              s.homepage    =  | 
| 11 | 
            -
              s.summary     =  | 
| 12 | 
            -
              s.description =  | 
| 7 | 
            +
              s.authors     = ['Vox Pupuli', 'Puppetlabs']
         | 
| 8 | 
            +
              s.email       = ['voxpupuli@groups.io']
         | 
| 9 | 
            +
              s.homepage    = 'https://github.com/voxpupuli/beaker-hiera'
         | 
| 10 | 
            +
              s.summary     = 'Hiera DSL Helpers!'
         | 
| 11 | 
            +
              s.description = 'For use for the Beaker acceptance testing tool'
         | 
| 13 12 | 
             
              s.license     = 'Apache2'
         | 
| 14 13 |  | 
| 15 14 | 
             
              s.files         = `git ls-files`.split("\n")
         | 
| 16 15 | 
             
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         | 
| 17 | 
            -
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 18 | 
            -
              s.require_paths = [ | 
| 16 | 
            +
              s.executables   = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
         | 
| 17 | 
            +
              s.require_paths = ['lib']
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              s.required_ruby_version = '~> 2.4'
         | 
| 19 20 |  | 
| 20 21 | 
             
              # Testing dependencies
         | 
| 22 | 
            +
              s.add_development_dependency 'pry', '~> 0.10'
         | 
| 23 | 
            +
              s.add_development_dependency 'rake', '~> 13.0'
         | 
| 21 24 | 
             
              s.add_development_dependency 'rspec', '~> 3.0'
         | 
| 22 | 
            -
              s.add_development_dependency 'rspec-its'
         | 
| 23 | 
            -
              s.add_development_dependency 'fakefs', '~> 0.6'
         | 
| 24 | 
            -
              s.add_development_dependency 'rake', '~> 10.1'
         | 
| 25 25 | 
             
              s.add_development_dependency 'simplecov'
         | 
| 26 | 
            -
              s.add_development_dependency 'pry', '~> 0.10'
         | 
| 27 26 |  | 
| 28 27 | 
             
              # Documentation dependencies
         | 
| 29 | 
            -
              s.add_development_dependency 'yard'
         | 
| 30 28 | 
             
              s.add_development_dependency 'markdown'
         | 
| 31 29 | 
             
              s.add_development_dependency 'thin'
         | 
| 30 | 
            +
              s.add_development_dependency 'yard'
         | 
| 32 31 |  | 
| 33 32 | 
             
              # Run time dependencies
         | 
| 34 | 
            -
              s.add_runtime_dependency ' | 
| 35 | 
            -
             | 
| 33 | 
            +
              s.add_runtime_dependency 'beaker', '~> 4.0'
         | 
| 36 34 | 
             
            end
         | 
| 37 | 
            -
             | 
    
        data/bin/beaker-hiera
    CHANGED
    
    | @@ -4,7 +4,7 @@ require 'rubygems' unless defined?(Gem) | |
| 4 4 | 
             
            require 'beaker-hiera'
         | 
| 5 5 |  | 
| 6 6 | 
             
            VERSION_STRING =
         | 
| 7 | 
            -
            "
         | 
| 7 | 
            +
              "
         | 
| 8 8 | 
             
                                             _ .--.
         | 
| 9 9 | 
             
                                            ( `    )
         | 
| 10 10 | 
             
                    beaker-hiera         .-'      `--,
         | 
| @@ -23,10 +23,8 @@ VERSION_STRING = | |
| 23 23 | 
             
                                  ||
         | 
| 24 24 | 
             
                                 |\"\"|
         | 
| 25 25 | 
             
                                 '=='
         | 
| 26 | 
            -
            "
         | 
| 26 | 
            +
            ".freeze
         | 
| 27 27 |  | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
            puts VERSION_STRING % [BeakerHiera::Version::STRING]
         | 
| 28 | 
            +
            puts format(VERSION_STRING, BeakerHiera::Version::STRING)
         | 
| 31 29 |  | 
| 32 30 | 
             
            exit 0
         | 
    
        data/lib/beaker-hiera.rb
    CHANGED
    
    | @@ -1,15 +1,6 @@ | |
| 1 | 
            +
            require 'beaker'
         | 
| 1 2 | 
             
            require 'beaker-hiera/helpers'
         | 
| 2 3 | 
             
            require 'beaker-hiera/version'
         | 
| 3 4 |  | 
| 4 | 
            -
            module Beaker
         | 
| 5 | 
            -
              module DSL
         | 
| 6 | 
            -
                module Helpers
         | 
| 7 | 
            -
                  module Hiera
         | 
| 8 | 
            -
                    include Beaker::DSL::Hiera::Helpers
         | 
| 9 | 
            -
                  end
         | 
| 10 | 
            -
                end
         | 
| 11 | 
            -
              end
         | 
| 12 | 
            -
            end
         | 
| 13 | 
            -
             | 
| 14 5 | 
             
            # Register the DSL extension
         | 
| 15 | 
            -
            Beaker::DSL.register( | 
| 6 | 
            +
            Beaker::DSL.register(Beaker::DSL::Helpers::Hiera)
         | 
    
        data/lib/beaker-hiera/helpers.rb
    CHANGED
    
    | @@ -1,29 +1,35 @@ | |
| 1 1 | 
             
            module Beaker
         | 
| 2 2 | 
             
              module DSL
         | 
| 3 3 | 
             
                module Helpers
         | 
| 4 | 
            -
                  # Methods that help you interact with your hiera installation | 
| 5 | 
            -
                  # for these methods to execute correctly
         | 
| 4 | 
            +
                  # Methods that help you interact with your hiera installation. Hiera must be installed
         | 
| 5 | 
            +
                  # for these methods to execute correctly.
         | 
| 6 6 | 
             
                  module Hiera
         | 
| 7 | 
            -
             | 
| 8 7 | 
             
                    # Write hiera config file on one or more provided hosts
         | 
| 9 8 | 
             
                    #
         | 
| 10 | 
            -
                    # @param[Host, Array<Host>, String, Symbol] host | 
| 11 | 
            -
                    # | 
| 12 | 
            -
                    #  | 
| 9 | 
            +
                    # @param [Host, Array<Host>, String, Symbol] host
         | 
| 10 | 
            +
                    #   One or more hosts to act upon, or a role (String or Symbol) that
         | 
| 11 | 
            +
                    #   identifies one or more hosts.
         | 
| 12 | 
            +
                    # @param [Array] hierarchy
         | 
| 13 | 
            +
                    #   One or more hierarchy paths
         | 
| 13 14 | 
             
                    def write_hiera_config_on(host, hierarchy)
         | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
                         | 
| 15 | 
            +
                      block_on host do |hst|
         | 
| 16 | 
            +
                        hiera_config = {
         | 
| 17 | 
            +
                          backends: 'yaml',
         | 
| 18 | 
            +
                          yaml: {
         | 
| 19 | 
            +
                            datadir: hiera_datadir(hst)
         | 
| 20 | 
            +
                          },
         | 
| 21 | 
            +
                          hierarchy: hierarchy,
         | 
| 22 | 
            +
                          logger: 'console'
         | 
| 23 | 
            +
                        }
         | 
| 24 | 
            +
                        create_remote_file hst, hst.puppet['hiera_config'], hiera_config.to_yaml
         | 
| 23 25 | 
             
                      end
         | 
| 24 26 | 
             
                    end
         | 
| 25 27 |  | 
| 26 28 | 
             
                    # Write hiera config file for the default host
         | 
| 29 | 
            +
                    #
         | 
| 30 | 
            +
                    # @param [Array] hierarchy
         | 
| 31 | 
            +
                    #   One or more hierarchy paths
         | 
| 32 | 
            +
                    #
         | 
| 27 33 | 
             
                    # @see #write_hiera_config_on
         | 
| 28 34 | 
             
                    def write_hiera_config(hierarchy)
         | 
| 29 35 | 
             
                      write_hiera_config_on(default, hierarchy)
         | 
| @@ -31,14 +37,20 @@ module Beaker | |
| 31 37 |  | 
| 32 38 | 
             
                    # Copy hiera data files to one or more provided hosts
         | 
| 33 39 | 
             
                    #
         | 
| 34 | 
            -
                    # @param[Host, Array<Host>, String, Symbol] host | 
| 35 | 
            -
                    # | 
| 36 | 
            -
                    #  | 
| 40 | 
            +
                    # @param [Host, Array<Host>, String, Symbol] host
         | 
| 41 | 
            +
                    #   One or more hosts to act upon, or a role (String or Symbol) that
         | 
| 42 | 
            +
                    #   identifies one or more hosts.
         | 
| 43 | 
            +
                    # @param [String] source
         | 
| 44 | 
            +
                    #   Directory containing the hiera data files.
         | 
| 37 45 | 
             
                    def copy_hiera_data_to(host, source)
         | 
| 38 46 | 
             
                      scp_to host, File.expand_path(source), hiera_datadir(host)
         | 
| 39 47 | 
             
                    end
         | 
| 40 48 |  | 
| 41 49 | 
             
                    # Copy hiera data files to the default host
         | 
| 50 | 
            +
                    #
         | 
| 51 | 
            +
                    # @param [String] source
         | 
| 52 | 
            +
                    #   Directory containing the hiera data files.
         | 
| 53 | 
            +
                    #
         | 
| 42 54 | 
             
                    # @see #copy_hiera_data_to
         | 
| 43 55 | 
             
                    def copy_hiera_data(source)
         | 
| 44 56 | 
             
                      copy_hiera_data_to(default, source)
         | 
| @@ -47,13 +59,13 @@ module Beaker | |
| 47 59 | 
             
                    # Get file path to the hieradatadir for a given host.
         | 
| 48 60 | 
             
                    # Handles whether or not a host is AIO-based & backwards compatibility
         | 
| 49 61 | 
             
                    #
         | 
| 50 | 
            -
                    # @param[Host] host | 
| 62 | 
            +
                    # @param [Host] host
         | 
| 63 | 
            +
                    #   Host you want to use the hieradatadir from
         | 
| 51 64 | 
             
                    #
         | 
| 52 65 | 
             
                    # @return [String] Path to the hiera data directory
         | 
| 53 66 | 
             
                    def hiera_datadir(host)
         | 
| 54 | 
            -
                       | 
| 67 | 
            +
                      File.join(host.puppet['codedir'], 'hieradata')
         | 
| 55 68 | 
             
                    end
         | 
| 56 | 
            -
             | 
| 57 69 | 
             
                  end
         | 
| 58 70 | 
             
                end
         | 
| 59 71 | 
             
              end
         | 
    
        data/lib/beaker-hiera/version.rb
    CHANGED
    
    
| @@ -1,90 +1,62 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 3 | 
             
            class ClassMixedWithDSLHelpers
         | 
| 4 | 
            -
              include  | 
| 5 | 
            -
              include Beaker::DSL::Helpers::Hiera
         | 
| 4 | 
            +
              include Beaker::DSL
         | 
| 6 5 |  | 
| 7 6 | 
             
              def logger
         | 
| 8 7 | 
             
                RSpec::Mocks::Double.new('logger').as_null_object
         | 
| 9 8 | 
             
              end
         | 
| 10 | 
            -
             | 
| 11 9 | 
             
            end
         | 
| 12 10 |  | 
| 13 11 | 
             
            describe ClassMixedWithDSLHelpers do
         | 
| 14 | 
            -
              let( | 
| 15 | 
            -
              let( | 
| 12 | 
            +
              let(:host) { instance_double('Beaker::Host') }
         | 
| 13 | 
            +
              let(:puppet) do
         | 
| 14 | 
            +
                { 'codedir' => '/usr/code', 'hiera_config' => '/usr/face' }
         | 
| 15 | 
            +
              end
         | 
| 16 16 |  | 
| 17 | 
            -
               | 
| 18 | 
            -
                 | 
| 19 | 
            -
             | 
| 20 | 
            -
                  host = make_host('testhost', { :platform => 'ubuntu' } )
         | 
| 21 | 
            -
                  hiera_config = '/usr/face'
         | 
| 22 | 
            -
                  allow( host ).to receive( :puppet ) { { 'hiera_config' => hiera_config } }
         | 
| 23 | 
            -
                  expect(subject).to receive(:create_remote_file).with(host, hiera_config, /#{host[:hieradatadir]}/)
         | 
| 24 | 
            -
                  subject.write_hiera_config_on(host, hierarchy)
         | 
| 25 | 
            -
                end
         | 
| 17 | 
            +
              before do
         | 
| 18 | 
            +
                allow(host).to receive(:puppet) { puppet }
         | 
| 19 | 
            +
              end
         | 
| 26 20 |  | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
                  expect(subject).to receive(:create_remote_file).with(host,  | 
| 21 | 
            +
              describe '#write_hiera_config_on' do
         | 
| 22 | 
            +
                let(:hierarchy) { ['nodes/%{::fqdn}', 'common'] }
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                it 'on host' do
         | 
| 25 | 
            +
                  expect(subject).to receive(:create_remote_file).with(host, '/usr/face', %r{datadir: "/usr/code/hieradata"})
         | 
| 32 26 | 
             
                  subject.write_hiera_config_on(host, hierarchy)
         | 
| 33 27 | 
             
                end
         | 
| 34 | 
            -
             | 
| 35 28 | 
             
              end
         | 
| 36 29 |  | 
| 37 | 
            -
              describe  | 
| 38 | 
            -
                let(:hierarchy) { [ | 
| 30 | 
            +
              describe '#write_hiera_config' do
         | 
| 31 | 
            +
                let(:hierarchy) { ['nodes/%{::fqdn}', 'common'] }
         | 
| 32 | 
            +
             | 
| 39 33 | 
             
                it 'delegates to #write_hiera_config_on with the default host' do
         | 
| 40 | 
            -
                   | 
| 41 | 
            -
                   | 
| 42 | 
            -
                   | 
| 43 | 
            -
                  subject.write_hiera_config( hierarchy )
         | 
| 34 | 
            +
                  expect(subject).to receive(:default).and_return(host)
         | 
| 35 | 
            +
                  expect(subject).to receive(:write_hiera_config_on).with(host, hierarchy).once
         | 
| 36 | 
            +
                  subject.write_hiera_config(hierarchy)
         | 
| 44 37 | 
             
                end
         | 
| 45 | 
            -
             | 
| 46 38 | 
             
              end
         | 
| 47 39 |  | 
| 48 | 
            -
              describe  | 
| 40 | 
            +
              describe '#copy_hiera_data_to' do
         | 
| 49 41 | 
             
                let(:path) { 'spec/fixtures/hieradata' }
         | 
| 50 | 
            -
                it 'on FOSS host' do
         | 
| 51 | 
            -
                  host = make_host('testhost', { :platform => 'ubuntu' } )
         | 
| 52 | 
            -
                  expect(subject).to receive(:scp_to).with(host, File.expand_path(path), host[:hieradatadir])
         | 
| 53 | 
            -
                  subject.copy_hiera_data_to(host, path)
         | 
| 54 | 
            -
                end
         | 
| 55 42 |  | 
| 56 | 
            -
                it 'on  | 
| 57 | 
            -
                   | 
| 58 | 
            -
                  expect(subject).to receive(:scp_to).with(host, File.expand_path(path), host[:hieradatadir])
         | 
| 43 | 
            +
                it 'on host' do
         | 
| 44 | 
            +
                  expect(subject).to receive(:scp_to).with(host, File.expand_path(path), '/usr/code/hieradata')
         | 
| 59 45 | 
             
                  subject.copy_hiera_data_to(host, path)
         | 
| 60 46 | 
             
                end
         | 
| 61 47 | 
             
              end
         | 
| 62 48 |  | 
| 63 | 
            -
              describe  | 
| 49 | 
            +
              describe '#copy_hiera_data' do
         | 
| 64 50 | 
             
                let(:path) { 'spec/fixtures/hieradata' }
         | 
| 51 | 
            +
             | 
| 65 52 | 
             
                it 'delegates to #copy_hiera_data_to with the default host' do
         | 
| 66 | 
            -
                   | 
| 67 | 
            -
                   | 
| 68 | 
            -
                   | 
| 69 | 
            -
                  subject.copy_hiera_data( path )
         | 
| 53 | 
            +
                  expect(subject).to receive(:default).and_return(host)
         | 
| 54 | 
            +
                  expect(subject).to receive(:copy_hiera_data_to).with(host, path).once
         | 
| 55 | 
            +
                  subject.copy_hiera_data(path)
         | 
| 70 56 | 
             
                end
         | 
| 71 | 
            -
             | 
| 72 57 | 
             
              end
         | 
| 73 58 |  | 
| 74 59 | 
             
              describe '#hiera_datadir' do
         | 
| 75 | 
            -
                it  | 
| 76 | 
            -
                  host['type'] = :aio
         | 
| 77 | 
            -
                  codedir = '/usr/code'
         | 
| 78 | 
            -
                  allow( host ).to receive( :puppet ) { { 'codedir' => codedir } }
         | 
| 79 | 
            -
                  correct_answer = File.join(codedir, 'hieradata')
         | 
| 80 | 
            -
                  expect( subject.hiera_datadir(host) ).to be === correct_answer
         | 
| 81 | 
            -
                end
         | 
| 82 | 
            -
             | 
| 83 | 
            -
                it 'returns the hieradata host value for anything not AIO (backwards compatible)' do
         | 
| 84 | 
            -
                  host_hieradatadir_value = '/home/fishing/man/pants'
         | 
| 85 | 
            -
                  host[:hieradatadir] = host_hieradatadir_value
         | 
| 86 | 
            -
                  expect( subject.hiera_datadir(host) ).to be === host_hieradatadir_value
         | 
| 87 | 
            -
                end
         | 
| 60 | 
            +
                it { expect(subject.hiera_datadir(host)).to eq('/usr/code/hieradata') }
         | 
| 88 61 | 
             
              end
         | 
| 89 | 
            -
             | 
| 90 62 | 
             
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -1,11 +1,8 @@ | |
| 1 1 | 
             
            require 'simplecov'
         | 
| 2 2 | 
             
            require 'beaker-hiera'
         | 
| 3 | 
            -
            require 'beaker_test_helpers'
         | 
| 4 | 
            -
            require 'helpers'
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            require 'rspec/its'
         | 
| 7 3 |  | 
| 8 4 | 
             
            RSpec.configure do |config|
         | 
| 9 | 
            -
              config. | 
| 10 | 
            -
             | 
| 11 | 
            -
            end
         | 
| 5 | 
            +
              config.mock_with :rspec do |mocks|
         | 
| 6 | 
            +
                mocks.verify_doubled_constant_names = true
         | 
| 7 | 
            +
              end
         | 
| 8 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,71 +1,58 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: beaker-hiera
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 | 
            +
            - Vox Pupuli
         | 
| 7 8 | 
             
            - Puppetlabs
         | 
| 8 9 | 
             
            autorequire: 
         | 
| 9 10 | 
             
            bindir: bin
         | 
| 10 11 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 12 | 
            +
            date: 2021-05-18 00:00:00.000000000 Z
         | 
| 12 13 | 
             
            dependencies:
         | 
| 13 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            -
              name:  | 
| 15 | 
            +
              name: pry
         | 
| 15 16 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 17 | 
             
                requirements:
         | 
| 17 18 | 
             
                - - "~>"
         | 
| 18 19 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: ' | 
| 20 | 
            +
                    version: '0.10'
         | 
| 20 21 | 
             
              type: :development
         | 
| 21 22 | 
             
              prerelease: false
         | 
| 22 23 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 24 | 
             
                requirements:
         | 
| 24 25 | 
             
                - - "~>"
         | 
| 25 26 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: ' | 
| 27 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            -
              name: rspec-its
         | 
| 29 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            -
                requirements:
         | 
| 31 | 
            -
                - - ">="
         | 
| 32 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: '0'
         | 
| 34 | 
            -
              type: :development
         | 
| 35 | 
            -
              prerelease: false
         | 
| 36 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            -
                requirements:
         | 
| 38 | 
            -
                - - ">="
         | 
| 39 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            -
                    version: '0'
         | 
| 27 | 
            +
                    version: '0.10'
         | 
| 41 28 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            -
              name:  | 
| 29 | 
            +
              name: rake
         | 
| 43 30 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 31 | 
             
                requirements:
         | 
| 45 32 | 
             
                - - "~>"
         | 
| 46 33 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: '0 | 
| 34 | 
            +
                    version: '13.0'
         | 
| 48 35 | 
             
              type: :development
         | 
| 49 36 | 
             
              prerelease: false
         | 
| 50 37 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 38 | 
             
                requirements:
         | 
| 52 39 | 
             
                - - "~>"
         | 
| 53 40 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: '0 | 
| 41 | 
            +
                    version: '13.0'
         | 
| 55 42 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            -
              name:  | 
| 43 | 
            +
              name: rspec
         | 
| 57 44 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 45 | 
             
                requirements:
         | 
| 59 46 | 
             
                - - "~>"
         | 
| 60 47 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: ' | 
| 48 | 
            +
                    version: '3.0'
         | 
| 62 49 | 
             
              type: :development
         | 
| 63 50 | 
             
              prerelease: false
         | 
| 64 51 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 52 | 
             
                requirements:
         | 
| 66 53 | 
             
                - - "~>"
         | 
| 67 54 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: ' | 
| 55 | 
            +
                    version: '3.0'
         | 
| 69 56 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 57 | 
             
              name: simplecov
         | 
| 71 58 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -81,21 +68,7 @@ dependencies: | |
| 81 68 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 69 | 
             
                    version: '0'
         | 
| 83 70 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            -
              name:  | 
| 85 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            -
                requirements:
         | 
| 87 | 
            -
                - - "~>"
         | 
| 88 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            -
                    version: '0.10'
         | 
| 90 | 
            -
              type: :development
         | 
| 91 | 
            -
              prerelease: false
         | 
| 92 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            -
                requirements:
         | 
| 94 | 
            -
                - - "~>"
         | 
| 95 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            -
                    version: '0.10'
         | 
| 97 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            -
              name: yard
         | 
| 71 | 
            +
              name: markdown
         | 
| 99 72 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 73 | 
             
                requirements:
         | 
| 101 74 | 
             
                - - ">="
         | 
| @@ -109,7 +82,7 @@ dependencies: | |
| 109 82 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 83 | 
             
                    version: '0'
         | 
| 111 84 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 112 | 
            -
              name:  | 
| 85 | 
            +
              name: thin
         | 
| 113 86 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 114 87 | 
             
                requirements:
         | 
| 115 88 | 
             
                - - ">="
         | 
| @@ -123,7 +96,7 @@ dependencies: | |
| 123 96 | 
             
                  - !ruby/object:Gem::Version
         | 
| 124 97 | 
             
                    version: '0'
         | 
| 125 98 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 126 | 
            -
              name:  | 
| 99 | 
            +
              name: yard
         | 
| 127 100 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 128 101 | 
             
                requirements:
         | 
| 129 102 | 
             
                - - ">="
         | 
| @@ -137,27 +110,29 @@ dependencies: | |
| 137 110 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 111 | 
             
                    version: '0'
         | 
| 139 112 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 140 | 
            -
              name:  | 
| 113 | 
            +
              name: beaker
         | 
| 141 114 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 142 115 | 
             
                requirements:
         | 
| 143 116 | 
             
                - - "~>"
         | 
| 144 117 | 
             
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            -
                    version:  | 
| 118 | 
            +
                    version: '4.0'
         | 
| 146 119 | 
             
              type: :runtime
         | 
| 147 120 | 
             
              prerelease: false
         | 
| 148 121 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 122 | 
             
                requirements:
         | 
| 150 123 | 
             
                - - "~>"
         | 
| 151 124 | 
             
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            -
                    version:  | 
| 125 | 
            +
                    version: '4.0'
         | 
| 153 126 | 
             
            description: For use for the Beaker acceptance testing tool
         | 
| 154 127 | 
             
            email:
         | 
| 155 | 
            -
            -  | 
| 128 | 
            +
            - voxpupuli@groups.io
         | 
| 156 129 | 
             
            executables:
         | 
| 157 130 | 
             
            - beaker-hiera
         | 
| 158 131 | 
             
            extensions: []
         | 
| 159 132 | 
             
            extra_rdoc_files: []
         | 
| 160 133 | 
             
            files:
         | 
| 134 | 
            +
            - ".github/workflows/release.yml"
         | 
| 135 | 
            +
            - ".github/workflows/test.yml"
         | 
| 161 136 | 
             
            - ".gitignore"
         | 
| 162 137 | 
             
            - ".rspec"
         | 
| 163 138 | 
             
            - ".simplecov"
         | 
| @@ -172,10 +147,8 @@ files: | |
| 172 147 | 
             
            - lib/beaker-hiera/helpers.rb
         | 
| 173 148 | 
             
            - lib/beaker-hiera/version.rb
         | 
| 174 149 | 
             
            - spec/beaker-hiera/helpers_spec.rb
         | 
| 175 | 
            -
            - spec/beaker_test_helpers.rb
         | 
| 176 | 
            -
            - spec/helpers.rb
         | 
| 177 150 | 
             
            - spec/spec_helper.rb
         | 
| 178 | 
            -
            homepage: https://github.com/ | 
| 151 | 
            +
            homepage: https://github.com/voxpupuli/beaker-hiera
         | 
| 179 152 | 
             
            licenses:
         | 
| 180 153 | 
             
            - Apache2
         | 
| 181 154 | 
             
            metadata: {}
         | 
| @@ -185,16 +158,16 @@ require_paths: | |
| 185 158 | 
             
            - lib
         | 
| 186 159 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 187 160 | 
             
              requirements:
         | 
| 188 | 
            -
              - - " | 
| 161 | 
            +
              - - "~>"
         | 
| 189 162 | 
             
                - !ruby/object:Gem::Version
         | 
| 190 | 
            -
                  version: ' | 
| 163 | 
            +
                  version: '2.4'
         | 
| 191 164 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 192 165 | 
             
              requirements:
         | 
| 193 166 | 
             
              - - ">="
         | 
| 194 167 | 
             
                - !ruby/object:Gem::Version
         | 
| 195 168 | 
             
                  version: '0'
         | 
| 196 169 | 
             
            requirements: []
         | 
| 197 | 
            -
            rubygems_version: 3. | 
| 170 | 
            +
            rubygems_version: 3.1.6
         | 
| 198 171 | 
             
            signing_key: 
         | 
| 199 172 | 
             
            specification_version: 4
         | 
| 200 173 | 
             
            summary: Hiera DSL Helpers!
         | 
    
        data/spec/beaker_test_helpers.rb
    DELETED
    
    | @@ -1,18 +0,0 @@ | |
| 1 | 
            -
            require 'yaml'
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            # These are specifically to mock Beaker methods necessary for testing
         | 
| 4 | 
            -
            # that will be available during runtime because this is never run separate
         | 
| 5 | 
            -
            # from Beaker itself.
         | 
| 6 | 
            -
            #
         | 
| 7 | 
            -
            # Including Beaker as a dependency would not work as a solution to this issue,
         | 
| 8 | 
            -
            # since that would make a cycle in the dependency graph, at least until
         | 
| 9 | 
            -
            # Beaker 3.0 happens and this is no longer a dependency of Beaker's.
         | 
| 10 | 
            -
            module BeakerTestHelpers
         | 
| 11 | 
            -
             | 
| 12 | 
            -
              def block_on hosts
         | 
| 13 | 
            -
                if block_given?
         | 
| 14 | 
            -
                  yield hosts
         | 
| 15 | 
            -
                end
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
             | 
| 18 | 
            -
            end
         | 
    
        data/spec/helpers.rb
    DELETED
    
    | @@ -1,109 +0,0 @@ | |
| 1 | 
            -
            module TestFileHelpers
         | 
| 2 | 
            -
              def create_files file_array
         | 
| 3 | 
            -
                file_array.each do |f|
         | 
| 4 | 
            -
                  FileUtils.mkdir_p File.dirname(f)
         | 
| 5 | 
            -
                  FileUtils.touch f
         | 
| 6 | 
            -
                end
         | 
| 7 | 
            -
              end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
              def fog_file_contents
         | 
| 10 | 
            -
                { :default => { :aws_access_key_id => "IMANACCESSKEY",
         | 
| 11 | 
            -
                                :aws_secret_access_key => "supersekritkey",
         | 
| 12 | 
            -
                                :aix_hypervisor_server => "aix_hypervisor.labs.net",
         | 
| 13 | 
            -
                                :aix_hypervisor_username => "aixer",
         | 
| 14 | 
            -
                                :aix_hypervisor_keyfile => "/Users/user/.ssh/id_rsa-acceptance",
         | 
| 15 | 
            -
                                :solaris_hypervisor_server => "solaris_hypervisor.labs.net",
         | 
| 16 | 
            -
                                :solaris_hypervisor_username => "harness",
         | 
| 17 | 
            -
                                :solaris_hypervisor_keyfile => "/Users/user/.ssh/id_rsa-old.private",
         | 
| 18 | 
            -
                                :solaris_hypervisor_vmpath => "rpoooool/zs",
         | 
| 19 | 
            -
                                :solaris_hypervisor_snappaths => ["rpoooool/USER/z0"],
         | 
| 20 | 
            -
                                :vsphere_server => "vsphere.labs.net",
         | 
| 21 | 
            -
                                :vsphere_username => "vsphere@labs.com",
         | 
| 22 | 
            -
                                :vsphere_password => "supersekritpassword"} }
         | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
            end
         | 
| 26 | 
            -
             | 
| 27 | 
            -
            module HostHelpers
         | 
| 28 | 
            -
              HOST_DEFAULTS = { :platform => 'unix',
         | 
| 29 | 
            -
                                :snapshot => 'pe',
         | 
| 30 | 
            -
                                :box => 'box_name',
         | 
| 31 | 
            -
                                :roles => ['agent'],
         | 
| 32 | 
            -
                                :snapshot => 'snap',
         | 
| 33 | 
            -
                                :ip => 'default.ip.address',
         | 
| 34 | 
            -
                                :box => 'default_box_name',
         | 
| 35 | 
            -
                                :box_url => 'http://default.box.url',
         | 
| 36 | 
            -
              }
         | 
| 37 | 
            -
             | 
| 38 | 
            -
              HOST_NAME     = "vm%d"
         | 
| 39 | 
            -
              HOST_SNAPSHOT = "snapshot%d"
         | 
| 40 | 
            -
              HOST_IP       = "ip.address.for.%s"
         | 
| 41 | 
            -
              HOST_BOX      = "%s_of_my_box"
         | 
| 42 | 
            -
              HOST_BOX_URL  = "http://address.for.my.box.%s"
         | 
| 43 | 
            -
              HOST_TEMPLATE = "%s_has_a_template"
         | 
| 44 | 
            -
             | 
| 45 | 
            -
              def logger
         | 
| 46 | 
            -
                double( 'logger' ).as_null_object
         | 
| 47 | 
            -
              end
         | 
| 48 | 
            -
             | 
| 49 | 
            -
              def make_opts
         | 
| 50 | 
            -
                opts = StringifyHash.new
         | 
| 51 | 
            -
                opts.merge( { :logger => logger,
         | 
| 52 | 
            -
                                                           :host_config => 'sample.config',
         | 
| 53 | 
            -
                                                           :type => nil,
         | 
| 54 | 
            -
                                                           :pooling_api => 'http://vcloud.delivery.puppetlabs.net/',
         | 
| 55 | 
            -
                                                           :datastore => 'instance0',
         | 
| 56 | 
            -
                                                           :folder => 'Delivery/Quality Assurance/Staging/Dynamic',
         | 
| 57 | 
            -
                                                           :resourcepool => 'delivery/Quality Assurance/Staging/Dynamic',
         | 
| 58 | 
            -
                                                           :gce_project => 'beaker-compute',
         | 
| 59 | 
            -
                                                           :gce_keyfile => '/path/to/keyfile.p12',
         | 
| 60 | 
            -
                                                           :gce_password => 'notasecret',
         | 
| 61 | 
            -
                                                           :gce_email => '12345678910@developer.gserviceaccount.com' } )
         | 
| 62 | 
            -
              end
         | 
| 63 | 
            -
             | 
| 64 | 
            -
              def generate_result (name, opts )
         | 
| 65 | 
            -
                result = double( 'result' )
         | 
| 66 | 
            -
                stdout = opts.has_key?(:stdout) ? opts[:stdout] : name
         | 
| 67 | 
            -
                stderr = opts.has_key?(:stderr) ? opts[:stderr] : name
         | 
| 68 | 
            -
                exit_code = opts.has_key?(:exit_code) ? opts[:exit_code] :  0
         | 
| 69 | 
            -
                exit_code = [exit_code].flatten
         | 
| 70 | 
            -
                allow( result ).to receive( :stdout ).and_return( stdout )
         | 
| 71 | 
            -
                allow( result ).to receive( :stderr ).and_return( stderr )
         | 
| 72 | 
            -
                allow( result ).to receive( :exit_code ).and_return( *exit_code )
         | 
| 73 | 
            -
                result
         | 
| 74 | 
            -
              end
         | 
| 75 | 
            -
             | 
| 76 | 
            -
              def make_host_opts name, opts
         | 
| 77 | 
            -
                make_opts.merge( { 'HOSTS' => { name => opts } } ).merge( opts )
         | 
| 78 | 
            -
              end
         | 
| 79 | 
            -
             | 
| 80 | 
            -
              def make_host name, host_hash
         | 
| 81 | 
            -
                host_hash = StringifyHash.new.merge(HOST_DEFAULTS.merge(host_hash))
         | 
| 82 | 
            -
             | 
| 83 | 
            -
                host = make_opts.merge(host_hash)
         | 
| 84 | 
            -
             | 
| 85 | 
            -
                allow(host).to receive( :name ).and_return( name )
         | 
| 86 | 
            -
                allow(host).to receive( :to_s ).and_return( name )
         | 
| 87 | 
            -
                allow(host).to receive( :exec ).and_return( generate_result( name, host_hash ) )
         | 
| 88 | 
            -
                host
         | 
| 89 | 
            -
              end
         | 
| 90 | 
            -
             | 
| 91 | 
            -
              def make_hosts preset_opts = {}, amt = 3
         | 
| 92 | 
            -
                hosts = []
         | 
| 93 | 
            -
                (1..amt).each do |num|
         | 
| 94 | 
            -
                  name = HOST_NAME % num
         | 
| 95 | 
            -
                  opts = { :snapshot => HOST_SNAPSHOT % num,
         | 
| 96 | 
            -
                           :ip => HOST_IP % name,
         | 
| 97 | 
            -
                           :template => HOST_TEMPLATE % name,
         | 
| 98 | 
            -
                           :box => HOST_BOX % name,
         | 
| 99 | 
            -
                           :box_url => HOST_BOX_URL % name }.merge( preset_opts )
         | 
| 100 | 
            -
                  hosts << make_host(name, opts)
         | 
| 101 | 
            -
                end
         | 
| 102 | 
            -
                hosts
         | 
| 103 | 
            -
              end
         | 
| 104 | 
            -
             | 
| 105 | 
            -
              def make_instance instance_data = {}
         | 
| 106 | 
            -
                OpenStruct.new instance_data
         | 
| 107 | 
            -
              end
         | 
| 108 | 
            -
             | 
| 109 | 
            -
            end
         |