Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123645
D8440.id30429.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D8440.id30429.diff
View Options
diff --git a/site-modules/profile/manifests/thanos/objstore_configs.pp b/site-modules/profile/manifests/thanos/objstore_configs.pp
new file mode 100644
--- /dev/null
+++ b/site-modules/profile/manifests/thanos/objstore_configs.pp
@@ -0,0 +1,31 @@
+# Thanos objstore configs
+class profile::thanos::objstore_configs {
+ include profile::thanos::base
+
+ $stores = lookup('thanos::stores')
+
+ $azure_account = lookup('thanos::objstore::azure_account')
+ $azure_account_key = lookup('thanos::objstore::azure_account_key')
+
+ $config_dir = $::profile::thanos::base::config_dir
+ $stores.each | $dataset_name, $service | {
+ $objstore_config = {
+ "type" => "AZURE",
+ "config" => {
+ "storage_account" => $azure_account,
+ "storage_account_key" => $azure_account_key,
+ "container" => $service['azure-storage-container'],
+ },
+ }
+
+ file {"${::profile::thanos::base::config_dir}/objstore-${dataset_name}.yml":
+ ensure => present,
+ owner => 'root',
+ group => 'prometheus',
+ mode => '0640',
+ content => inline_yaml($objstore_config),
+ require => File[$::profile::thanos::base::config_dir],
+ }
+ ~> Service <| tag == "thanos-objstore-${dataset_name}" |>
+ }
+}
diff --git a/site-modules/profile/manifests/thanos/store.pp b/site-modules/profile/manifests/thanos/store.pp
--- a/site-modules/profile/manifests/thanos/store.pp
+++ b/site-modules/profile/manifests/thanos/store.pp
@@ -2,6 +2,7 @@
class profile::thanos::store {
include profile::thanos::base
include profile::thanos::tls_certificate
+ include profile::thanos::objstore_configs
$cert_paths = $::profile::thanos::tls_certificate::cert_paths
@@ -9,30 +10,8 @@
$stores = lookup('thanos::stores')
- $azure_account = lookup('thanos::objstore::azure_account')
- $azure_account_key = lookup('thanos::objstore::azure_account_key')
-
$config_dir = $::profile::thanos::base::config_dir
$stores.each | $dataset_name, $service | {
- $objstore_config = {
- "type" => "AZURE",
- "config" => {
- "storage_account" => $azure_account,
- "storage_account_key" => $azure_account_key,
- "container" => $service['azure-storage-container'],
- },
- }
-
- $objstore_config_file = "${::profile::thanos::base::config_dir}/objstore-${dataset_name}.yml"
- file {$objstore_config_file:
- ensure => present,
- owner => 'root',
- group => 'prometheus',
- mode => '0640',
- content => inline_yaml($objstore_config),
- require => File[$::profile::thanos::base::config_dir],
- }
-
$port_http = $service['store']['port-http']
$http_address = "${internal_ip}:${port_http}"
$http_target = "${swh_hostname['internal_fqdn']}:${port_http}"
@@ -64,7 +43,7 @@
File[$cert_paths['fullchain']],
File[$cert_paths['privkey']],
],
- tag => 'thanos-store',
+ tag => ['thanos-store', "thanos-objstore-${dataset_name}"],
}
# And clean up drop-in files for old service instances
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 19 2024, 4:19 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3228911
Attached To
D8440: Split thanos objstore configuration management to separate class
Event Timeline
Log In to Comment