Puppet: Difference between revisions
From Tamerz
Jump to navigationJump to search
Created page with "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 h..." |
No edit summary |
||
Line 12: | Line 12: | ||
Then, run "pdk update" to apply the changes. | Then, run "pdk update" to apply the changes. | ||
Apache example with settings I commonly use: | |||
class { 'apache': } | |||
apache::vhost { 'myserver.domain.local': | |||
port => '443', | |||
ssl => true, | |||
docroot => '/var/www/html', | |||
override => ['All'], | |||
options => ['-Indexes'], | |||
setenv => ['MY_ENV_VARIABLE production'], | |||
proxy_preserve_host => true, | |||
proxy_pass => [ | |||
{ 'path' => '/backend/', 'url' => 'http://localhost:9000/backend/' }, | |||
{ 'path' => '/static/', 'url' => 'http://localhost:9001/static/' }, | |||
], | |||
} |
Revision as of 06:35, 7 December 2021
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.
Apache example with settings I commonly use:
class { 'apache': } apache::vhost { 'myserver.domain.local': port => '443', ssl => true, docroot => '/var/www/html', override => ['All'], options => ['-Indexes'], setenv => ['MY_ENV_VARIABLE production'], proxy_preserve_host => true, proxy_pass => [ { 'path' => '/backend/', 'url' => 'http://localhost:9000/backend/' }, { 'path' => '/static/', 'url' => 'http://localhost:9001/static/' }, ], }