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

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

diff --git a/data/defaults.yaml b/data/defaults.yaml
index 5e32c8067..7c3ec3cf2 100644
--- a/data/defaults.yaml
+++ b/data/defaults.yaml
@@ -1943,6 +1943,7 @@ swh::deploy::worker::swh_lister_github::config:
       - swh_lister_github_discover
       - swh_lister_github_refresh
 
+swh::deploy::worker::swh_lister_gitlab::config_file: "%{hiera('swh::conf_directory')}/lister_gitlab.yml"
 swh::deploy::worker::swh_lister_gitlab::concurrency: 1
 swh::deploy::worker::swh_lister_gitlab::loglevel: warning
 # Contains a password: in private data
@@ -1959,6 +1960,16 @@ swh::deploy::worker::swh_lister_gitlab::config:
     args:
       db: "postgresql://%{hiera('swh::deploy::worker::swh_lister_gitlab::db::user')}:%{hiera('swh::deploy::worker::swh_lister_gitlab::db::password')}@%{hiera('swh::deploy::worker::swh_lister_gitlab::db::host')}/%{hiera('swh::deploy::worker::swh_lister_gitlab::db::dbname')}"
   # credentials in private data
+  celery:
+    task_broker: "%{alias('swh::deploy::scheduler::task_broker')}"
+    task_modules:
+      - swh.lister.gitlab.tasks
+    task_queues:
+      - swh.lister.gitlab.tasks.IncrementalGitLabLister
+      - swh.lister.gitlab.tasks.RangeGitLabLister
+      - swh.lister.gitlab.tasks.FullGitLabRelister
+      - swh_lister_gitlab_discover
+      - swh_lister_gitlab_refresh
 
 swh::deploy::worker::swh_lister_pypi::concurrency: 1
 swh::deploy::worker::swh_lister_pypi::loglevel: warning
diff --git a/site-modules/profile/manifests/swh/deploy/worker/swh_lister_gitlab.pp b/site-modules/profile/manifests/swh/deploy/worker/swh_lister_gitlab.pp
index ddae6b32d..da6127f8b 100644
--- a/site-modules/profile/manifests/swh/deploy/worker/swh_lister_gitlab.pp
+++ b/site-modules/profile/manifests/swh/deploy/worker/swh_lister_gitlab.pp
@@ -4,7 +4,7 @@ class profile::swh::deploy::worker::swh_lister_gitlab {
   $loglevel = lookup('swh::deploy::worker::swh_lister_gitlab::loglevel')
   $task_broker = lookup('swh::deploy::worker::swh_lister_gitlab::task_broker')
 
-  $config_file = '/etc/softwareheritage/lister-gitlab.yml'
+  $config_file = lookup('swh::deploy::worker::swh_lister_gitlab::config_file')
   $config = lookup('swh::deploy::worker::swh_lister_gitlab::config', Hash, 'deep')
 
   $task_modules = ['swh.lister.gitlab.tasks']
@@ -12,7 +12,7 @@ class profile::swh::deploy::worker::swh_lister_gitlab {
 
   include ::profile::swh::deploy::base_lister
 
-  ::profile::swh::deploy::worker::instance {'swh_lister_gitlab':
+  ::profile::swh::deploy::worker::instance {'lister_gitlab':
     ensure       => present,
     concurrency  => $concurrency,
     loglevel     => $loglevel,
-- 
GitLab