diff --git a/data/defaults.yaml b/data/defaults.yaml --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -1708,16 +1708,20 @@ - /api/1/entity/ - /api/1/provenance/ -swh::deploy::scheduler::conf_file: "%{hiera('swh::conf_directory')}/scheduler.ini" +swh::deploy::scheduler::conf_file: "%{hiera('swh::conf_directory')}/scheduler.yml" swh::deploy::scheduler::user: swhscheduler swh::deploy::scheduler::group: swhscheduler swh::deploy::scheduler::db::host: db swh::deploy::scheduler::db::dbname: softwareheritage-scheduler swh::deploy::scheduler::db::user: swhscheduler # swh::deploy::scheduler::db::password in private data -swh::deploy::scheduler::database: "host=%{hiera('swh::deploy::scheduler::db::host')} dbname=%{hiera('swh::deploy::scheduler::db::dbname')} user=%{hiera('swh::deploy::scheduler::db::user')} password=%{hiera('swh::deploy::scheduler::db::password')}" # swh::deploy::scheduler::task_broker::password in private data swh::deploy::scheduler::task_broker: "amqp://swhproducer:%{hiera('swh::deploy::scheduler::task_broker::password')}@rabbitmq:5672//" +swh::deploy::scheduler::config: + scheduler: + cls: local + args: + db: "host=%{hiera('swh::deploy::scheduler::db::host')} dbname=%{hiera('swh::deploy::scheduler::db::dbname')} user=%{hiera('swh::deploy::scheduler::db::user')} password=%{hiera('swh::deploy::scheduler::db::password')}" swh::deploy::scheduler::task_packages: - python3-swh.lister - python3-swh.loader.debian diff --git a/site-modules/profile/manifests/swh/deploy/scheduler.pp b/site-modules/profile/manifests/swh/deploy/scheduler.pp --- a/site-modules/profile/manifests/swh/deploy/scheduler.pp +++ b/site-modules/profile/manifests/swh/deploy/scheduler.pp @@ -1,9 +1,9 @@ # Deployment of swh-scheduler related utilities class profile::swh::deploy::scheduler { - $conf_file = lookup('swh::deploy::scheduler::conf_file') + $config_file = lookup('swh::deploy::scheduler::conf_file') $user = lookup('swh::deploy::scheduler::user') $group = lookup('swh::deploy::scheduler::group') - $database = lookup('swh::deploy::scheduler::database') + $config = lookup('swh::deploy::scheduler::config') $task_broker = lookup('swh::deploy::scheduler::task_broker') $task_packages = lookup('swh::deploy::scheduler::task_packages') @@ -47,15 +47,12 @@ notify => Service[$services], } - # Template uses variables - # - $database - # - file {$conf_file: + file {$config_file: ensure => present, owner => 'root', group => $group, mode => '0640', - content => template('profile/swh/deploy/scheduler/scheduler.ini.erb'), + content => inline_template("<%= @config.to_yaml %>\n"), notify => Service[$services], } @@ -98,7 +95,7 @@ require => [ Package[$packages], Package[$task_packages], - File[$conf_file], + File[$config_file], File[$worker_conf_file], Systemd::Unit_File[$runner_unit_name], ], @@ -109,7 +106,7 @@ enable => true, require => [ Package[$packages], - File[$conf_file], + File[$config_file], File[$worker_conf_file], Systemd::Unit_File[$listener_unit_name], ], diff --git a/site-modules/profile/templates/swh/deploy/scheduler/scheduler.ini.erb b/site-modules/profile/templates/swh/deploy/scheduler/scheduler.ini.erb deleted file mode 100644 --- a/site-modules/profile/templates/swh/deploy/scheduler/scheduler.ini.erb +++ /dev/null @@ -1,6 +0,0 @@ -# swh.scheduler configuration file -# File managed by puppet - modifications will be overwritten - -[main] -scheduling_db = <%= @database %> -