From 4e0bd191c38e4af9a764bbc33455dd75616c79a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 17 Jul 2023 18:04:35 +0200 Subject: [PATCH] Move the Hello World lua app to its own recipe Use it in the development environment --- roles/openresty.rb | 7 ++++++- site-cookbooks/kosmos_openresty/recipes/default.rb | 5 ----- site-cookbooks/kosmos_openresty/recipes/hello_world.rb | 9 +++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 site-cookbooks/kosmos_openresty/recipes/hello_world.rb diff --git a/roles/openresty.rb b/roles/openresty.rb index 0ccccbd..35edc0b 100644 --- a/roles/openresty.rb +++ b/roles/openresty.rb @@ -1,11 +1,16 @@ name "openresty" +development_run_list = %w( + kosmos_openresty::default + kosmos_openresty::hello_world +) + default_run_list = %w( kosmos_openresty::default ) env_run_lists( '_default' => default_run_list, - 'development' => default_run_list, + 'development' => development_run_list, 'production' => default_run_list ) diff --git a/site-cookbooks/kosmos_openresty/recipes/default.rb b/site-cookbooks/kosmos_openresty/recipes/default.rb index ab845b1..d2f6f03 100644 --- a/site-cookbooks/kosmos_openresty/recipes/default.rb +++ b/site-cookbooks/kosmos_openresty/recipes/default.rb @@ -5,8 +5,3 @@ # Install openresty from official packages include_recipe 'openresty::apt_package' - -openresty_site 'hello_world' do - template 'hello_world.conf.erb' - action :enable -end diff --git a/site-cookbooks/kosmos_openresty/recipes/hello_world.rb b/site-cookbooks/kosmos_openresty/recipes/hello_world.rb new file mode 100644 index 0000000..252aed6 --- /dev/null +++ b/site-cookbooks/kosmos_openresty/recipes/hello_world.rb @@ -0,0 +1,9 @@ +# +# Cookbook:: kosmos_openresty +# Recipe:: hello_world +# + +openresty_site 'hello_world' do + template 'hello_world.conf.erb' + action :enable +end