From b084fc9852d25918b3ce788627c7b363a94ca447 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 25 Sep 2024 18:21:56 +0200 Subject: [PATCH] Final fixes --- README.md | 14 +++++++------- spec/defines/install_packages_spec.rb | 8 +++++--- spec/defines/project_spec.rb | 9 +++------ spec/defines/report_spec.rb | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 79d4caa..51348ab 100644 --- a/README.md +++ b/README.md @@ -26,19 +26,19 @@ This module requires functions provided by the [Puppet Labs Stdlib Module](https Install the module from the Forge: -```bash {"id":"01J8MJ40BQWMDAJC3F710YREN4"} +```bash puppet module install example42/puppi ``` To use the Puppi just declare or include the puppi class -```ruby {"id":"01J8MJ40BQWMDAJC3F7286XQQK"} +```ruby include puppi ``` If you have resources conflicts, do not install automatically the Puppi dependencies (commands and packages) -```ruby {"id":"01J8MJ40BQWMDAJC3F72Q9E3VZ"} +```ruby class { 'puppi': install_dependencies => false, } @@ -50,7 +50,7 @@ Once Puppi is installed you can use it to: * Easily define in Puppet manifests Web Applications deploy procedures. For example: -```ruby {"id":"01J8MJ40BQWMDAJC3F748G9HWW"} +```ruby puppi::project::war { "myapp": source => "http://repo.example42.com/deploy/prod/myapp.war", deploy_root => "/opt/tomcat/myapp/webapps", @@ -68,7 +68,7 @@ Once enabled for each module you have puppi check, info and log commands. To enable Puppi integration in OldGen (version 1) Example42 Modules, set in the scope these variables: -```html {"id":"01J8MJ40BQWMDAJC3F74Q6B0KZ"} +```html $puppi = yes # Enables puppi integration $monitor = yes # Enables automatic monitoring $monitor_tool = "puppi" # Sets puppi as monitoring tool @@ -76,7 +76,7 @@ $monitor_tool = "puppi" # Sets puppi as monitoring tool ## USAGE OF THE PUPPI COMMAND (OLD GEN) -```bash {"id":"01J8MJ40BQWMDAJC3F7615PETB"} +```bash puppi [ -options ] ``` @@ -122,7 +122,7 @@ You can also provide some options: Some common puppi commands when you log for an application deployment: -```bash {"id":"01J8MJ40BQWMDAJC3F790N39R5"} +```bash puppi check puppi log & # (More readable if done on another window) puppi deploy myapp diff --git a/spec/defines/install_packages_spec.rb b/spec/defines/install_packages_spec.rb index b59b248..80ea66d 100644 --- a/spec/defines/install_packages_spec.rb +++ b/spec/defines/install_packages_spec.rb @@ -9,9 +9,11 @@ let(:title) { 'namevar' } let(:node) { 'rspec.example42.com' } let(:pre_condition) { 'include puppi' } - let(:params) do - {} - end + let(:params) { + { + 'packages' => 'top', + } + } it { is_expected.to compile } end end diff --git a/spec/defines/project_spec.rb b/spec/defines/project_spec.rb index 933ca97..39eca77 100644 --- a/spec/defines/project_spec.rb +++ b/spec/defines/project_spec.rb @@ -16,12 +16,9 @@ } } - describe 'Test puppi report step file creation' do - it 'should create a puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_ensure('present') - end - it 'should populate correctly the puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n") + describe 'Test puppi project configuration file' do + it 'should create a puppi::project configuration file' do + should contain_file('/etc/puppi/projects/myapp/config').with_ensure('present') end end diff --git a/spec/defines/report_spec.rb b/spec/defines/report_spec.rb index 2201e27..e0cf299 100644 --- a/spec/defines/report_spec.rb +++ b/spec/defines/report_spec.rb @@ -20,7 +20,7 @@ describe 'Test puppi report step file creation' do it 'should create a puppi::report step file' do - should contain_file('/etc/puppi/projects/myapp/report/50-get').with_ensure('file') + should contain_file('/etc/puppi/projects/myapp/report/50-get').with_ensure('present') end it 'should populate correctly the puppi::report step file' do should contain_file('/etc/puppi/projects/myapp/report/50-get').with_content("su - root -c \"export project=myapp && /etc/puppi/scripts/echo \"\n")