From fcf93b88d53da4cd6e4a865c58334cb9b6435637 Mon Sep 17 00:00:00 2001 From: Patrick Wyatt Date: Mon, 18 Aug 2014 17:34:14 -0700 Subject: [PATCH 1/2] Fix runit initialization on new server Move "include_recipe 'runit'" to happen before creating default.json since runit subscribes *immediately* to changes to that file. This fixes first Chef run on a new system. --- recipes/_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/_service.rb b/recipes/_service.rb index bc933646..4a181a8d 100644 --- a/recipes/_service.rb +++ b/recipes/_service.rb @@ -25,6 +25,8 @@ # Select service user & group case node[:consul][:init_style] when 'runit' + include_recipe 'runit' + consul_user = node[:consul][:service_user] consul_group = node[:consul][:service_group] consul_directories << '/var/log/consul' @@ -116,8 +118,6 @@ subscribes :restart, "file[#{node[:consul][:config_dir]}/default.json]", :delayed end when 'runit' - include_recipe 'runit' - runit_service 'consul' do supports status: true, restart: true, reload: true action [:enable, :start] From ad8bc89edb70b1123c7413ed8e357917531d3f49 Mon Sep 17 00:00:00 2001 From: Patrick Wyatt Date: Mon, 18 Aug 2014 18:18:17 -0700 Subject: [PATCH 2/2] Added kitchen test for runit --- .kitchen.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index 146cc5b7..78c320e6 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -26,6 +26,13 @@ suites: attributes: consul: datacenter: FortMeade + - name: runit + run_list: + - recipe[consul::default] + attributes: + consul: + datacenter: FortMeade + init_style: runit - name: ui run_list: - recipe[consul::default]