@@ -32,7 +32,17 @@ def target_platform
3232 hosts . first [ :platform ]
3333 end
3434
35+ def log_output_errors ( result )
36+ return if result [ 'status' ] == 'success'
37+ out = result . dig ( 'value' , '_output' ) || 'Unknown result output'
38+ puts logger . info ( out )
39+ end
40+
3541 it 'works with version and install tasks' do
42+ # Specify the first released version for each target platform. When adding a new
43+ # OS, you'll typically want to specify 'latest' to install from nightlies, since
44+ # official packages won't be released until later. During the N+1 release, you'll
45+ # want to change `target_platform` to be the first version (N) that added the OS.
3646 puppet_6_version = case target_platform
3747 when %r{debian-11}
3848 '6.24.0'
@@ -50,17 +60,20 @@ def target_platform
5060 '6.15.0'
5161 when %r{osx-11}
5262 '6.23.0'
53- when %r{osx-12}
63+ when %r{osx-12-x86_64 }
5464 '6.27.1'
65+ when %r{osx-12-arm}
66+ 'latest'
5567 when %r{ubuntu-22.04}
5668 'latest'
5769 else
5870 '6.17.0'
5971 end
6072
61- # platforms that only have nightly builds available
73+ # platforms that only have nightly builds available. Once a platform
74+ # is released, it should be removed from this list.
6275 case target_platform
63- when %r{ubuntu-22.04}
76+ when %r{ubuntu-22.04} , %r{osx-12-arm}
6477 puppet_6_collection = 'puppet6-nightly'
6578 puppet_7_collection = 'puppet7-nightly'
6679 else
@@ -69,8 +82,10 @@ def target_platform
6982 end
7083
7184 # we can only tests puppet 6.x -> 6.y upgrades if there multiple versions
85+ # Once there a platform has been released more than once, it can be removed
86+ # from this list.
7287 multiple_puppet6_versions = case target_platform
73- when %r{osx-12}
88+ when %r{osx-12-x86_64} , %r{osx-12-arm }
7489 false
7590 when %r{ubuntu-22.04}
7691 false
@@ -94,6 +109,11 @@ def target_platform
94109 'version' => puppet_6_version ,
95110 'stop_service' => true } )
96111
112+ results . each do |result |
113+ logger . info ( "Installed puppet-agent on #{ result [ 'target' ] } : #{ result [ 'status' ] } " )
114+ log_output_errors ( result )
115+ end
116+
97117 expect ( results ) . to all ( include ( 'status' => 'success' ) )
98118
99119 # It installed a version older than latest puppet6
@@ -121,6 +141,11 @@ def target_platform
121141 # Expect nothing to happen and receive a message regarding this
122142 results = run_task ( 'puppet_agent::install' , 'target' , { 'collection' => puppet_6_collection } )
123143
144+ results . each do |result |
145+ logger . info ( "Ensuring installed puppet-agent on #{ result [ 'target' ] } : #{ result [ 'status' ] } " )
146+ log_output_errors ( result )
147+ end
148+
124149 results . each do |res |
125150 expect ( res ) . to include ( 'status' => 'success' )
126151 expect ( res [ 'value' ] [ '_output' ] ) . to match ( %r{Version parameter not defined and agent detected. Nothing to do.} )
@@ -144,6 +169,12 @@ def target_platform
144169
145170 # Upgrade to latest puppet6 version
146171 results = run_task ( 'puppet_agent::install' , 'target' , { 'collection' => 'puppet6' , 'version' => 'latest' } )
172+
173+ results . each do |result |
174+ logger . info ( "Upgraded puppet-agent to latest puppet6 on #{ result [ 'target' ] } : #{ result [ 'status' ] } " )
175+ log_output_errors ( result )
176+ end
177+
147178 expect ( results ) . to all ( include ( 'status' => 'success' ) )
148179
149180 # Verify that it upgraded
@@ -173,6 +204,12 @@ def target_platform
173204
174205 # Succesfully upgrade from puppet6 to puppet7
175206 results = run_task ( 'puppet_agent::install' , 'target' , { 'collection' => puppet_7_collection , 'version' => 'latest' } )
207+
208+ results . each do |result |
209+ logger . info ( "Upgraded puppet-agent to puppet7 on #{ result [ 'target' ] } : #{ result [ 'status' ] } " )
210+ log_output_errors ( result )
211+ end
212+
176213 expect ( results ) . to all ( include ( 'status' => 'success' ) )
177214
178215 # Verify that it upgraded
0 commit comments