From 05d0a19b5f3d1ecf6ee8b72e4caabdc3e2f32733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 24 Mar 2023 21:21:02 +0700 Subject: [PATCH] Add Sentry client recipe and role Configures a local domain for Sentry in the hostsfile. --- nodes/akkounts-1.json | 3 ++- roles/sentry_client.rb | 11 +++++++++++ site-cookbooks/kosmos_sentry/recipes/client.rb | 11 +++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 roles/sentry_client.rb create mode 100644 site-cookbooks/kosmos_sentry/recipes/client.rb diff --git a/nodes/akkounts-1.json b/nodes/akkounts-1.json index 1922a96..5932557 100644 --- a/nodes/akkounts-1.json +++ b/nodes/akkounts-1.json @@ -74,6 +74,7 @@ "role[base]", "role[kvm_guest]", "role[ldap_client]", + "role[sentry_client]", "role[akkounts]" ] -} \ No newline at end of file +} diff --git a/roles/sentry_client.rb b/roles/sentry_client.rb new file mode 100644 index 0000000..a478b6b --- /dev/null +++ b/roles/sentry_client.rb @@ -0,0 +1,11 @@ +name "sentry_client" + +default_run_list = %w( + kosmos_sentry::client +) + +env_run_lists( + '_default' => default_run_list, + 'development' => default_run_list, + 'production' => default_run_list +) diff --git a/site-cookbooks/kosmos_sentry/recipes/client.rb b/site-cookbooks/kosmos_sentry/recipes/client.rb new file mode 100644 index 0000000..a850f4e --- /dev/null +++ b/site-cookbooks/kosmos_sentry/recipes/client.rb @@ -0,0 +1,11 @@ +# +# Cookbook:: kosmos_sentry +# Recipe:: client +# + +sentry_host = search(:node, "role:sentry").first["knife_zero"]["host"] + +hostsfile_entry sentry_host do + hostname 'sentry.kosmos.local' + action :create +end