biemond-oradb icon indicating copy to clipboard operation
biemond-oradb copied to clipboard

Add remote_file parameter to opatchupgrade.pp

Open fduranti opened this issue 7 years ago • 1 comments

For almost all the manifest that manage files for installation/extraction is possible to define if the files are local (so they just need extraction) or remote (in this case they're first copied with a file resource then extracted).

The only exception is opatchupgrade that don't have the remote_file parameter and will always copy the file instead of just extracting if it's local on the server.

This is creating some problem in my runs because I'm normally running puppet in a noop mode. In noop the file with "source" parameter that copy the file from a local mounted file system fail because the filesystem is still not mounted as the run of the agent is done in "noop".

When i do a forced --no-noop run all work correctly beacuse the staging filesystem is mounted before the file resource that will copy the file locally will run.

This behaviour is creating some problem to the vrealize automation plugin for puppet because it will try to do a run in noop and this run will return error every time and the provisioning is failing.

If the behaviour of opatchupgrade manifest can change to be uniform with all the other manifests (installdb, opatch) being able to define a remote_file parameters will solve the problem because in that case the opatchupgrade manifest will not try to copy a file that still don't exist (until the remote staging directory is mounted).

I'm not sure I was able to explain the problem in a good way :) sorry This is the error I get from a puppet run in noop:

Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/Notify[oradb::opatchupgrade opatch_home2 NotFound installed - performing upgrade]/message: current_value 'absent', should be 'oradb::opatchupgrade opatch_home2 NotFound installed - performing upgrade' (noop)
Error: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/File[/var/tmp/orainstall/p6880880_122010_Linux-x86-64_OPatchv12.2.0.1.8.zip]: Could not evaluate: Could not retrieve information from environment production source(s) file:/oracle/stage/UTILITY/p6880880_122010_Linux-x86-64_OPatchv12.2.0.1.8.zip

In the same manifest the installdb (with remote_file=false) is not getting any error because it will just uncompress the files instead of copying them:

Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Notify[oradb::installdb /oracle/app/12102 does not exists]/message: current_value 'absent', should be 'oradb::installdb /oracle/app/12102 does not exists' (noop)
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Db_directory_structure[oracle structure 12.1.0.2_home2]/ensure: current_value 'absent', should be 'present' (noop)
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Exec[extract /var/tmp/orainstall/linuxamd64_12102_database_1of2.zip]/returns: current_value 'notrun', should be ['0'] (noop)
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Exec[extract /var/tmp/orainstall/linuxamd64_12102_database_2of2.zip]/returns: current_value 'notrun', should be ['0'] (noop)

Doing a no-noop run will first mount the filesystems and them extract oracle, copy the opatch upgrade:

Notice: /Stage[main]/Profile::Oracle::Storage/Mount[/oracle/stage]/ensure: ensure changed 'unmounted' to 'mounted'
...
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Exec[extract /var/tmp/orainstall/linuxamd64_12102_database_1of2.zip]/returns: executed successfully
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Installdb[home2]/Exec[extract /var/tmp/orainstall/linuxamd64_12102_database_2of2.zip]/returns: executed successfully
....
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/Notify[oradb::opatchupgrade opatch_home2 NotFound installed - performing upgrade]/message: defined 'message' as 'oradb::opatchupgrade opatch_home2 NotFound installed - performing upgrade'
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/File[/var/tmp/orainstall/p6880880_122010_Linux-x86-64_OPatchv12.2.0.1.8.zip]/ensure: defined content as '{md5}8db975372e66df4e057534fbed82de41'
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/File[/oracle/app/12102/OPatch]/ensure: removed
Notice: /Stage[main]/Profile::Oracle::Software/Oradb::Opatchupgrade[opatch_home2]/Exec[extract opatch opatch_home2 p6880880_122010_Linux-x86-64_OPatchv12.2.0.1.8.zip]/returns: executed successfully

fduranti avatar Jan 16 '18 23:01 fduranti

thanks for reporting , I changed it and will push the change today

biemond avatar Jan 22 '18 09:01 biemond