{"action":"opened","issue":{"url":"https://api.github.com/repos/hw-cookbooks/omnibus_updater/issues/77","labels_url":"https://api.github.com/repos/hw-cookbooks/omnibus_updater/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/hw-cookbooks/omnibus_updater/issues/77/comments","events_url":"https://api.github.com/repos/hw-cookbooks/omnibus_updater/issues/77/events","html_url":"https://github.com/hw-cookbooks/omnibus_updater/issues/77","id":68502048,"number":77,"title":"install is delayed instead of immediate?","user":{"login":"keen99","id":1108844,"avatar_url":"https://avatars.githubusercontent.com/u/1108844?v=3","gravatar_id":"","url":"https://api.github.com/users/keen99","html_url":"https://github.com/keen99","followers_url":"https://api.github.com/users/keen99/followers","following_url":"https://api.github.com/users/keen99/following{/other_user}","gists_url":"https://api.github.com/users/keen99/gists{/gist_id}","starred_url":"https://api.github.com/users/keen99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keen99/subscriptions","organizations_url":"https://api.github.com/users/keen99/orgs","repos_url":"https://api.github.com/users/keen99/repos","events_url":"https://api.github.com/users/keen99/events{/privacy}","received_events_url":"https://api.github.com/users/keen99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-14T21:26:18Z","updated_at":"2015-04-14T21:26:18Z","closed_at":null,"body":"\r\n\r\n\r\nSo been intermittently trying to track down why updater doesn't update first thing, since it's first in my runlist.  (fallout from this can be that other cookbooks that require a > version of chef may fail, since we haven't updated yet).\r\n\r\n\r\nLooks like the install notifier block has a \":delayed\" on it's notifies - instead of an \":immediately\".  \r\n\r\nAny particular reason we'd want a delay?  This block triggers after the remote file pull is complete - shouldn't it then immediately kick the install?\r\n\r\nIf we do want a delay, perhaps we could make it configurable?  For my environment, it's critical that the update happen before other cookbooks kick in.\r\n\r\n\r\n\r\n\r\nthe code in question:\r\n\r\n````\r\nruby_block 'Omnibus Chef install notifier' do\r\n  block{ true }\r\n  action :nothing\r\n  subscribes :create, resources(:remote_file => \"omnibus_remote[#{File.basename(remote_path)}]\"), :immediately\r\n  notifies :run, resources(:execute => \"omnibus_install[#{File.basename(remote_path)}]\"), :delayed\r\n  only_if { node['chef_packages']['chef']['version'] != node['omnibus_updater']['version'] }\r\nend\r\n````\r\nhttps://github.com/hw-cookbooks/omnibus_updater/blob/0e25bc21424fd20fda5271d15804e63b99801d58/recipes/installer.rb#L66\r\n\r\n\r\n\r\n\r\n\r\nfiltered log snippet below\r\n\r\n````\r\n$ grep omnibus_ chef.log\r\n[2015-04-14T21:10:33+00:00] INFO: Run List expands to [omnibus_updater, hipchat-notify, zce_yum::yum-central-provisioning-ec2, zce_yum::yum-zepel, zce_elb_register, zce_chef::chef-deploy, redislabs]\r\n[2015-04-14T21:10:52+00:00] INFO: Processing directory[/opt/zynga/chef/Provisioning/omnibus_updater] action create (omnibus_updater::downloader line 38)\r\n[2015-04-14T21:10:52+00:00] INFO: directory[/opt/zynga/chef/Provisioning/omnibus_updater] created directory /opt/zynga/chef/Provisioning/omnibus_updater\r\n[2015-04-14T21:10:52+00:00] INFO: Processing remote_file[omnibus_remote[chef-11.18.6-1.el6.x86_64.rpm]] action create_if_missing (omnibus_updater::downloader line 42)\r\n[2015-04-14T21:10:52+00:00] INFO: remote_file[omnibus_remote[chef-11.18.6-1.el6.x86_64.rpm]] created file /opt/zynga/chef/Provisioning/omnibus_updater/chef-11.18.6-1.el6.x86_64.rpm\r\n[2015-04-14T21:10:57+00:00] INFO: remote_file[omnibus_remote[chef-11.18.6-1.el6.x86_64.rpm]] updated file contents /opt/zynga/chef/Provisioning/omnibus_updater/chef-11.18.6-1.el6.x86_64.rpm\r\n[2015-04-14T21:10:58+00:00] INFO: remote_file[omnibus_remote[chef-11.18.6-1.el6.x86_64.rpm]] sending create action to ruby_block[Omnibus Chef install notifier] (immediate)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing ruby_block[Omnibus Chef install notifier] action create (omnibus_updater::installer line 62)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing file[/tmp/nocheck] action create (omnibus_updater::installer line 23)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing service[chef-client] action nothing (omnibus_updater::installer line 28)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing ruby_block[omnibus chef killer] action nothing (omnibus_updater::installer line 32)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] action nothing (omnibus_updater::installer line 42)\r\n[2015-04-14T21:10:58+00:00] INFO: Processing ruby_block[Omnibus Chef install notifier] action nothing (omnibus_updater::installer line 62)\r\n[2015-04-14T21:11:57+00:00] INFO: ruby_block[Omnibus Chef install notifier] sending run action to execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] (delayed)\r\n[2015-04-14T21:11:57+00:00] INFO: Processing execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] action run (omnibus_updater::installer line 42)\r\n[2015-04-14T21:11:57+00:00] INFO: execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] sh(rpm -Uvh --oldpackage /opt/zynga/chef/Provisioning/omnibus_updater/chef-11.18.6-1.el6.x86_64.rpm)\r\n[2015-04-14T21:11:58+00:00] INFO: warning: /opt/zynga/chef/Provisioning/omnibus_updater/chef-11.18.6-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY\r\n[2015-04-14T21:12:02+00:00] INFO: execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] ran successfully\r\n[2015-04-14T21:12:02+00:00] INFO: execute[omnibus_install[chef-11.18.6-1.el6.x86_64.rpm]] sending create action to ruby_block[omnibus chef killer] (immediate)\r\n[2015-04-14T21:12:02+00:00] INFO: Processing ruby_block[omnibus chef killer] action create (omnibus_updater::installer line 32)\r\n```"}}