Difference between revisions of "Puppet"

From wiki.tamerz.com
Jump to: navigation, search
 
Line 1: Line 1:
 +
When creating a new module with PDK, running unit tests gives the following message:
  
== Setting up a Puppet development environment on MacOS ==
+
Deprecation Warnings:
Install Puppet Development Kit (PDK): [https://puppet.com/download-puppet-development-kit https://puppet.com/download-puppet-development-kit]
+
 +
puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you
  
Install Homebrew: [https://brew.sh/ https://brew.sh/]
+
To switch to ":mocha" as mentioned, create a ".sync.yml" file in the module directory and add the following lines:
  
Install [https://github.com/rbenv/rbenv rbenv]:
+
---
    $ brew install rbenv
+
spec/spec_helper.rb:
    $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
+
  mock_with: ':rspec'
  
Close your terminal and open a new one to activate the new settings.
+
Then, run "pdk update" to apply the changes.
 
+
Install Ruby:
+
    $ rbenv install 2.4.1
+
 
+
Create a new module with PDK:
+
    $ pdk new module mymodule
+
 
+
Go into your module directory and run:
+
    $ rbenv local 2.4.1
+
    $ gem install bundle
+
    $ bundle install
+

Latest revision as of 02:34, 27 November 2019

When creating a new module with PDK, running unit tests gives the following message:

Deprecation Warnings:

puppetlabs_spec_helper: defaults `mock_with` to `:mocha`. See https://github.com/puppetlabs/puppetlabs_spec_helper#mock_with to choose a sensible value for you

To switch to ":mocha" as mentioned, create a ".sync.yml" file in the module directory and add the following lines:

---
spec/spec_helper.rb:
  mock_with: ':rspec'

Then, run "pdk update" to apply the changes.