Hi,
I have below two manifests in puppet, I have few challenges when I use serverspec tests.
1)
file_line { 'functions':
ensure => present,
path => '/etc/functions',
line => 'umask 009',
match => '^umask.*$',
}
}
I tried below snippet for serverspec
describe file('/etc/init.d/functions') do
its(:content) { should match 'umask' }
its(:value) { should eq '027' }
but getting below error
Failure/Error: its(:value) { should eq '027' }
NoMethodError:
undefined method `value' for File "/etc/functions":Serverspec::Type::File
require 'spec_helper'
how I can check in configuration file "/etc/functions" the value 009 updated correctly by using the serverspec.
2) This is for hiera in puppet, below is a basic package installation in puppet
class packages {
$pack_array = hiera_array('list')
package { $pack_array : ensure => installed }
}
I tried below server spec and its working
packages = ['ksh','unzip','wget','zip']
describe "Install Base Packages" do
packages.each do|base|
describe package(base) do
it { should be_installed }
end
end
end
puppet manifest takes "list" values from yaml file. Is there any option in the server spec that we can pass array values from a yaml file like how we do it in rspec-puppet.
↧