Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
88a709352d
|
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"id": "sentry",
|
||||||
|
"launchpad_rpc_shared_secret": {
|
||||||
|
"encrypted_data": "Y8BFYM4YZjz/nv4zHEAkyheAVB18HdNi1KzvqJrRXXnnYI5bC8fVO9g=\n",
|
||||||
|
"iv": "1txuL+Uy+HIIs6CF\n",
|
||||||
|
"auth_tag": "aVHnUaVRo/xXeZRh0Z1pbw==\n",
|
||||||
|
"version": 3,
|
||||||
|
"cipher": "aes-256-gcm"
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-10
@@ -10,7 +10,7 @@
|
|||||||
"automatic": {
|
"automatic": {
|
||||||
"fqdn": "sentry-1",
|
"fqdn": "sentry-1",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"os_version": "5.4.0-1087-kvm",
|
"os_version": "6.8.0-134-generic",
|
||||||
"hostname": "sentry-1",
|
"hostname": "sentry-1",
|
||||||
"ipaddress": "192.168.122.251",
|
"ipaddress": "192.168.122.251",
|
||||||
"roles": [
|
"roles": [
|
||||||
@@ -21,14 +21,14 @@
|
|||||||
"recipes": [
|
"recipes": [
|
||||||
"kosmos-base",
|
"kosmos-base",
|
||||||
"kosmos-base::default",
|
"kosmos-base::default",
|
||||||
|
"kosmos_prometheus::node_exporter",
|
||||||
"kosmos_kvm::guest",
|
"kosmos_kvm::guest",
|
||||||
"kosmos_sentry",
|
"kosmos_sentry",
|
||||||
"kosmos_sentry::default",
|
"kosmos_sentry::default",
|
||||||
"apt::default",
|
"apt::default",
|
||||||
"timezone_iii::default",
|
"timezone_iii::default",
|
||||||
"timezone_iii::debian",
|
"timezone_iii::debian",
|
||||||
"ntp::default",
|
"kosmos-base::journald_conf",
|
||||||
"ntp::apparmor",
|
|
||||||
"kosmos-base::systemd_emails",
|
"kosmos-base::systemd_emails",
|
||||||
"apt::unattended-upgrades",
|
"apt::unattended-upgrades",
|
||||||
"kosmos-base::firewall",
|
"kosmos-base::firewall",
|
||||||
@@ -38,21 +38,20 @@
|
|||||||
"postfix::_attributes",
|
"postfix::_attributes",
|
||||||
"postfix::sasl_auth",
|
"postfix::sasl_auth",
|
||||||
"hostname::default",
|
"hostname::default",
|
||||||
"firewall::default",
|
"firewall::default"
|
||||||
"chef-sugar::default"
|
|
||||||
],
|
],
|
||||||
"platform": "ubuntu",
|
"platform": "ubuntu",
|
||||||
"platform_version": "20.04",
|
"platform_version": "24.04",
|
||||||
"cloud": null,
|
"cloud": null,
|
||||||
"chef_packages": {
|
"chef_packages": {
|
||||||
"chef": {
|
"chef": {
|
||||||
"version": "17.10.3",
|
"version": "18.7.10",
|
||||||
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.10.3/lib",
|
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.7.10/lib",
|
||||||
"chef_effortless": null
|
"chef_effortless": null
|
||||||
},
|
},
|
||||||
"ohai": {
|
"ohai": {
|
||||||
"version": "17.9.0",
|
"version": "18.2.5",
|
||||||
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/ohai-17.9.0/lib/ohai"
|
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.5/lib/ohai"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
node.default["sentry"]["repo"] = "https://github.com/getsentry/self-hosted"
|
node.default["sentry"]["repo"] = "https://github.com/getsentry/self-hosted"
|
||||||
node.default["sentry"]["revision"] = "23.3.1"
|
# Make sure to first upgrade to hard stop version if required:
|
||||||
|
# https://develop.sentry.dev/self-hosted/releases/
|
||||||
|
node.default["sentry"]["revision"] = "26.6.0"
|
||||||
|
|
||||||
node.default["sentry"]["port"] = 80
|
node.default["sentry"]["port"] = 80
|
||||||
node.default["sentry"]["retention_days"] = 90
|
node.default["sentry"]["retention_days"] = 90
|
||||||
node.default["sentry"]["allowed_ips"] = nil
|
node.default["sentry"]["allowed_ips"] = nil
|
||||||
# The Sentry setup requires docker-compose >= 1.28, which is newer than the
|
|
||||||
# latest stable version for Ubuntu 20.04
|
|
||||||
node.default["sentry"]["docker-compose"]["version"] = "2.17.0"
|
|
||||||
node.default["sentry"]["docker-compose"]["checksum"] = "65edee934d988471c40ef31305731dbb4381d3cb0aeea13342119b61772f85e2"
|
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
# Recipe:: default
|
# Recipe:: default
|
||||||
#
|
#
|
||||||
|
|
||||||
package "docker"
|
apt_repository "docker" do
|
||||||
|
uri "https://download.docker.com/linux/ubuntu"
|
||||||
|
key "https://download.docker.com/linux/ubuntu/gpg"
|
||||||
|
components ["stable"]
|
||||||
|
end
|
||||||
|
|
||||||
remote_file "/usr/local/bin/docker-compose" do
|
%w[docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin].each do |pkg|
|
||||||
source "https://github.com/docker/compose/releases/download/v#{node["sentry"]["docker-compose"]["version"]}/docker-compose-linux-x86_64"
|
package pkg
|
||||||
checksum node["sentry"]["docker-compose"]["checksum"]
|
|
||||||
mode '0755'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
deploy_path = "/opt/sentry"
|
deploy_path = "/opt/sentry"
|
||||||
@@ -16,24 +18,22 @@ deploy_path = "/opt/sentry"
|
|||||||
git deploy_path do
|
git deploy_path do
|
||||||
repository node["sentry"]["repo"]
|
repository node["sentry"]["repo"]
|
||||||
revision node["sentry"]["revision"]
|
revision node["sentry"]["revision"]
|
||||||
|
# TODO test and uncomment
|
||||||
|
# notifies :run, "execute[run_install_script]", :immediately
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO
|
execute "run_install_script" do
|
||||||
# Automatically run install script if sentry/sentry.conf.py does not exist yet
|
cwd deploy_path
|
||||||
|
command "./install.sh --apply-automatic-config-updates --no-report-self-hosted-issues"
|
||||||
|
action :nothing
|
||||||
|
end
|
||||||
|
|
||||||
|
credentials = data_bag_item("credentials", "sentry")
|
||||||
|
|
||||||
env_config = {
|
env_config = {
|
||||||
sentry_event_retention_days: node["sentry"]["retention_days"],
|
sentry_event_retention_days: node["sentry"]["retention_days"],
|
||||||
sentry_bind: node["sentry"]["bind"] || node["sentry"]["port"],
|
sentry_bind: node["sentry"]["bind"] || node["sentry"]["port"],
|
||||||
# Default values from upstream
|
launchpad_rpc_shared_secret: credentials["launchpad_rpc_shared_secret"]
|
||||||
compose_project_name: "sentry-self-hosted",
|
|
||||||
sentry_image: "getsentry/sentry:nightly",
|
|
||||||
snuba_image: "getsentry/snuba:nightly",
|
|
||||||
relay_image: "getsentry/relay:nightly",
|
|
||||||
symbolicator_image: "getsentry/symbolicator:nightly",
|
|
||||||
wal2json_version: "latest",
|
|
||||||
healthcheck_interval: "30s",
|
|
||||||
healthcheck_timeout: "60s",
|
|
||||||
healthcheck_retries: "10"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template "#{deploy_path}/.env.custom" do
|
template "#{deploy_path}/.env.custom" do
|
||||||
@@ -41,7 +41,8 @@ template "#{deploy_path}/.env.custom" do
|
|||||||
mode 0600
|
mode 0600
|
||||||
sensitive true
|
sensitive true
|
||||||
variables config: env_config
|
variables config: env_config
|
||||||
notifies :restart, "service[sentry]", :delayed
|
# TODO
|
||||||
|
# notifies :restart, "service[sentry]", :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
systemd_unit "sentry.service" do
|
systemd_unit "sentry.service" do
|
||||||
@@ -52,11 +53,13 @@ systemd_unit "sentry.service" do
|
|||||||
},
|
},
|
||||||
Service: {
|
Service: {
|
||||||
Type: "oneshot",
|
Type: "oneshot",
|
||||||
RemainAfterExit: "true",
|
RemainAfterExit: "yes",
|
||||||
WorkingDirectory: deploy_path,
|
WorkingDirectory: deploy_path,
|
||||||
ExecStart: "docker-compose --env-file #{deploy_path}/.env.custom up -d --remove-orphans",
|
ExecStart: "docker compose --env-file .env --env-file .env.custom up -d --wait",
|
||||||
ExecStop: "docker-compose stop",
|
ExecStop: "docker compose down --remove-orphans",
|
||||||
StandardOutput: "syslog"
|
StandardOutput: "syslog",
|
||||||
|
TimeoutStartSec: 600,
|
||||||
|
TimeoutStopSec: 300
|
||||||
},
|
},
|
||||||
Install: {
|
Install: {
|
||||||
WantedBy: "multi-user.target"
|
WantedBy: "multi-user.target"
|
||||||
@@ -67,7 +70,7 @@ systemd_unit "sentry.service" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
service "sentry" do
|
service "sentry" do
|
||||||
action [:enable, :start]
|
action [:enable]
|
||||||
end
|
end
|
||||||
|
|
||||||
include_recipe 'firewall'
|
include_recipe 'firewall'
|
||||||
|
|||||||
Reference in New Issue
Block a user