When you say \xE2\x80\x9Cretrigger the recipe after reboot\xE2\x80\x9D I think you\xE2\x80\x99re saying you\xE2\x80\x99d like to run chef-client again after reboot, correct? \xC2\xA0 Right now you can get this behavior by running chef-client as a Windows service (see http://docs.opscode.com/install_windows.html) \xE2\x80\x93 the service is always \xE2\x80\x9Crunning,\xE2\x80\x9D so if you reboot, chef-client will run whatever recipes are in the runlist again. \xC2\xA0 If you\xE2\x80\x99re using chef-solo (looks like you are), we don\xE2\x80\x99t have direct support for this at the moment, but assuming you can reliably detect the reboot required (e.g. from the return code of the installation command), you could use the scheduled tasks resource in the Windows cookbook to schedule a command line to run chef-solo once at some short interval in the future (say, 2 minutes from the current time) and then reboot the system (via the reboot resource). Then the Windows task scheduler would run chef-solo after the system rebooted. You could also use various \xE2\x80\x9Crun once\xE2\x80\x9D registry keys are start menu locations to get chef-solo to run after reboot. \xC2\xA0 Certainly if this is a common enough scenario for the audience here I think the reboot handling should be added to the resources themselves in a more direct way to avoid convoluted recipes. \xC2\xA0 -Adam \xC2\xA0 Hi, \xC2\xA0 \xC2\xA0 # Cookbook Name:: HPSiteScope # Recipe:: default # # Copyright 2013, YOUR_COMPANY_NAME # # All rights reserved - Do Not Redistribute # include_recipe "windows::default" \xC2\xA0 directory "d:/HPSiteScope.11.2" do \xC2\xA0 action :create end \xC2\xA0 directory "d:/HPSiteScope.11.2/HPSiteScope.11.22" do \xC2\xA0 action :create end \xC2\xA0 cookbook_file "d:/HPSiteScope.11.2/HPSiteScope_11.20_setup.exe" do cookbook "HPSiteScope" action :create not_if { ::File.exists?("d:/HPSiteScope.11.2/HPSiteScope_11.20_setup.exe") } end \xC2\xA0 \xC2\xA0 cookbook_file "d:/HPSiteScope.11.2/ovinstallparams.ini" do cookbook "HPSiteScope" action :create not_if { ::File.exists?("d:/HPSiteScope.11.2/ovinstallparams.ini") } end \xC2\xA0 remote_directory "d:/HPSiteScope.11.2/packages" do \xC2\xA0 source 'packages.11.20' \xC2\xA0 recursive true \xC2\xA0 action :create end \xC2\xA0 execute " HPsitescope" do print " Installation of site scope package started" command "start /wait d:/HPSiteScope.11.2/HPSiteScope_11.20_setup.exe -i silent" end \xC2\xA0 cookbook_file "d:/HPSiteScope.11.2/HPSiteScope.11.22/HPSiS1122_11.22_setup.exe" do cookbook "HPSiteScope" action :create not_if { ::File.exists?("d:/HPSiteScope.11.2/HPSiteScope.11.22/HPSiS1122_11.22_setup.exe") } action :create end \xC2\xA0 remote_directory "d:/HPSiteScope.11.2/HPSiteScope.11.22/packages" do \xC2\xA0 source 'packages.11.22' \xC2\xA0 recursive true \xC2\xA0 action :create end \xC2\xA0 execute " upgrading sitescope to 11.22" do print " Installation of site scope package started" command "start /wait d:/HPSiteScope.11.2/HPSiteScope.11.22/HPSiS1122_11.22_setup.exe -i silent" end \xC2\xA0 cookbook_file "d:/HPSiteScope.11.2/SS1122130614-11.22.000-WinNT4.0.msi" do cookbook "HPSiteScope" action :create not_if { ::File.exists?("d:/HPSiteScope.11.2/SS1122130614-11.22.000-WinNT4.0.msi") } end \xC2\xA0 windows_package "SS1122130614-11.22.000-WinNT4.0.msi" do source "D:\\HPSiteScope.11.2\\SS1122130614-11.22.000-WinNT4.0.msi" options '/L*V "D:\\SiS_patch_install.log"' installer_type :msi end \xC2\xA0 \xC2\xA0 I am trying to install and upgrade a sitescope package in single recipe but it is failing because reboot is required before upgrade the package 1) HPSiteScope_11.20_setup.exe -- installation 2) HPSiS1122_11.22_setup.exe -- upgrade 3) SS1122130614-11.22.000-WinNT4.0.msi -- upgrade After installing the first package(HPSiteScope_11.20_setup.exe ) reboot is required to update the folder relevant with this package . Issue: upgrade is looking for that folder relevant with that package Is there is any way to retrigger the recipe after reboot? To add the bat job in window to trigger "chef-solo" to upgrade the package once after reboot of the recipe for installation. ? Any cookbook is there for installing HP sitescope package in window? Thanks & Regards, Premkumar UTS \xC2\xA0 From: Gontrand, Premkumar \xC2\xA0 Hi, \xC2\xA0 \xC2\xA0 I am trying to install msi patch for hpsitescope in window 2008 server I am getting the below error while I am compiling \xC2\xA0 default.rb \xC2\xA0 include_recipe "windows::default" \xC2\xA0 \xC2\xA0 windows_package "S1122130614-11.22.000-WinNT4.0.msi" do source "D:\\HPSiteScope.11.2\\S1122130614-11.22.000-WinNT4.0.msi" options "/q" installer_type :msi action :install end \xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0\xC2\xA0 \xC2\xA0 Error: \xC2\xA0 \xC2\xA0 * gem_package[win32-mutex] action install\xE2\x86\x90[0m (up to date)\xE2\x86\x90[0m Recipe: HPSiteScope::default\xE2\x86\x90[0m \xC2\xA0 * windows_package[S1122130614-11.22.000-WinNT4.0.msi] action install\xE2\x86\x90[0m\xE2\x86\x90[0m ================================================================================\xE2\x86\x90[0m \xE2\x86\x90[31mError executing action `install` on resource 'windows_package[S1122130614-11.22.000-WinNT4.0.msi]'\xE2\x86\x90[0m ================================================================================\xE2\x86\x90[0m \xC2\xA0 \xE2\x86\x90[0m NameError\xE2\x86\x90[0m ---------\xE2\x86\x90[0m uninitialized constant Chef::Win32::Registry::HKEY_LOCAL_MACHINE\xE2\x86\x90[0m \xC2\xA0 \xE2\x86\x90[0m Resource Declaration:\xE2\x86\x90[0m ---------------------\xE2\x86\x90[0m # In C:/Users/chef/cookbooks/HPSiteScope/recipes/default.rb \xC2\xA0 \xC2\xA0 4: windows_package "S1122130614-11.22.000-WinNT4.0.msi" do \xC2\xA0 5: source "D:\\HPSiteScope.11.2\\S1122130614-11.22.000-WinNT4.0.msi" \xC2\xA0 6: options "/q" \xC2\xA0 7: installer_type :msi \xC2\xA0 8: action :install \xC2\xA0 9: end\xE2\x86\x90[0m \xC2\xA0 \xE2\x86\x90[0m Compiled Resource:\xE2\x86\x90[0m ------------------\xE2\x86\x90[0m # Declared in C:/Users/chef/cookbooks/HPSiteScope/recipes/default.rb:4:in `from_file' \xC2\xA0 windows_package("S1122130614-11.22.000-WinNT4.0.msi") do \xC2\xA0 action [:install] \xC2\xA0 retries 0 \xC2\xA0 retry_delay 2 \xC2\xA0 cookbook_name :HPSiteScope \xC2\xA0 recipe_name "default" \xC2\xA0 source "D:\\HPSiteScope.11.2\\S1122130614-11.22.000-WinNT4.0.msi" \xC2\xA0 options "/q" \xC2\xA0 installer_type :msi \xC2\xA0 package_name "S1122130614-11.22.000-WinNT4.0.msi" end \xE2\x86\x90[0m \xC2\xA0 \xE2\x86\x90[0m \xC2\xA0 \xC2\xA0 I am new to development and window \xC2\xA0Any one faced the issue similar to that? \xC2\xA0 \xC2\xA0 Is there is anything that need to be along with the code. \xC2\xA0 Thanks & Regards, Premkumar \xC2\xA0 |
Archive powered by MHonArc 2.6.16.