From 6f8387fbe23b32f2edb77e1c5dc3b31d20eac9ee Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Fri, 15 Feb 2019 23:40:09 +0100
Subject: [PATCH] lister-pypi: Update configuration

Related T1525
---
 data/defaults.yaml                                        | 8 ++++++++
 .../manifests/swh/deploy/worker/swh_lister_pypi.pp        | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/data/defaults.yaml b/data/defaults.yaml
index 7c3ec3cf2..8c7c9017e 100644
--- a/data/defaults.yaml
+++ b/data/defaults.yaml
@@ -1971,6 +1971,7 @@ swh::deploy::worker::swh_lister_gitlab::config:
       - swh_lister_gitlab_discover
       - swh_lister_gitlab_refresh
 
+swh::deploy::worker::swh_lister_pypi::config_file: "%{hiera('swh::conf_directory')}/lister_pypi.yml"
 swh::deploy::worker::swh_lister_pypi::concurrency: 1
 swh::deploy::worker::swh_lister_pypi::loglevel: warning
 # Contains a password: in private data
@@ -1987,6 +1988,13 @@ swh::deploy::worker::swh_lister_pypi::config:
     args:
       db: "postgresql://%{hiera('swh::deploy::worker::swh_lister_pypi::db::user')}:%{hiera('swh::deploy::worker::swh_lister_pypi::db::password')}@%{hiera('swh::deploy::worker::swh_lister_pypi::db::host')}/%{hiera('swh::deploy::worker::swh_lister_pypi::db::dbname')}"
   # credentials in private data
+  celery:
+    task_broker: "%{alias('swh::deploy::scheduler::task_broker')}"
+    task_modules:
+      - swh.lister.pypi.tasks
+    task_queues:
+      - swh.lister.pypi.tasks.PyPIListerTask
+      - swh_lister_pypi_refresh
 
 swh::deploy::worker::swh_storage_archiver::conf_directory: "%{hiera('swh::conf_directory')}/archiver"
 swh::deploy::worker::swh_storage_archiver::conf_file: "%{hiera('swh::deploy::worker::swh_storage_archiver::conf_directory')}/worker.yml"
diff --git a/site-modules/profile/manifests/swh/deploy/worker/swh_lister_pypi.pp b/site-modules/profile/manifests/swh/deploy/worker/swh_lister_pypi.pp
index 8ac6f82e7..cb46d986b 100644
--- a/site-modules/profile/manifests/swh/deploy/worker/swh_lister_pypi.pp
+++ b/site-modules/profile/manifests/swh/deploy/worker/swh_lister_pypi.pp
@@ -4,7 +4,7 @@ class profile::swh::deploy::worker::swh_lister_pypi {
   $loglevel = lookup('swh::deploy::worker::swh_lister_pypi::loglevel')
   $task_broker = lookup('swh::deploy::worker::swh_lister_pypi::task_broker')
 
-  $config_file = '/etc/softwareheritage/lister-pypi.yml'
+  $config_file = lookup('swh::deploy::worker::swh_lister_pypi::config_file')
   $config = lookup('swh::deploy::worker::swh_lister_pypi::config', Hash, 'deep')
 
   $task_modules = ['swh.lister.pypi.tasks']
@@ -12,7 +12,7 @@ class profile::swh::deploy::worker::swh_lister_pypi {
 
   include ::profile::swh::deploy::base_lister
 
-  ::profile::swh::deploy::worker::instance {'swh_lister_pypi':
+  ::profile::swh::deploy::worker::instance {'lister_pypi':
     ensure       => present,
     concurrency  => $concurrency,
     loglevel     => $loglevel,
-- 
GitLab