From 16f0e1afc7a0b30121ffa6084ec344bca2d7c6d1 Mon Sep 17 00:00:00 2001 From: jevgenik Date: Tue, 1 Sep 2015 18:42:42 +0300 Subject: [PATCH] Do not start lxc-net service if it does not exist --- recipes/default.rb | 1 + recipes/service.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index 499a243..ea8c928 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -8,6 +8,7 @@ dpkg_autostart 'lxc-net' do allow false + only_if{ node.platform_family?('debian') and File.exist?("/etc/default/lxc-net") } end include_recipe 'lxc::install_dependencies' diff --git a/recipes/service.rb b/recipes/service.rb index 89e87f2..65acff2 100644 --- a/recipes/service.rb +++ b/recipes/service.rb @@ -7,7 +7,7 @@ provider service_provider action [:enable, :start] subscribes :restart, 'file[/etc/default/lxc]' - only_if{ node.platform_family?('debian') } + only_if{ node.platform_family?('debian') and File.exist?("/etc/default/lxc-net") } supports [:restart, :status] end