From 7620435ad3d1bead8b741a6120bc6c6395d676f7 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 11 Oct 2020 22:16:17 +0200 Subject: [PATCH] add options to mamage repos --- defaults/main.yml | 7 +++++++ molecule/centos7/converge.yml | 3 +++ templates/etc/sysconfig/renovate.j2 | 11 ++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c6772ad..c0fd276 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,13 @@ renovatebot_interval: daily # @end # @var renovatebot_github_token: $ "_unset_" renovatebot_autodiscover: False +# @var renovatebot_autodiscover_filter:description: > +# A [minimatch](https://www.npmjs.com/package/minimatch) glob-style pattern for filtering +# autodiscovered repositories. The sessing only works if `renovatebot_autodiscover` is enabled. +# @end +# @var renovatebot_autodiscover_filter:example: $ "project/*" +# @var renovatebot_autodiscover_filter: $ "_unset_" +renovatebot_repositories: [] renovatebot_endpoint: "https://github.company.com/api/v3" renovatebot_git_author: "Renovate Bot " renovatebot_platform: github diff --git a/molecule/centos7/converge.yml b/molecule/centos7/converge.yml index 037d2c7..fedefef 100644 --- a/molecule/centos7/converge.yml +++ b/molecule/centos7/converge.yml @@ -10,6 +10,9 @@ - python-virtualenv renovatebot_service_stopped: True renovatebot_token: personal-access-token + renovatebot_repositories: + - ansible/test + - project/demo roles: - role: xoxys.docker_engine diff --git a/templates/etc/sysconfig/renovate.j2 b/templates/etc/sysconfig/renovate.j2 index c03a2f9..ce8adef 100644 --- a/templates/etc/sysconfig/renovate.j2 +++ b/templates/etc/sysconfig/renovate.j2 @@ -3,9 +3,18 @@ {% if renovatebot_github_token is defined %} GITHUB_COM_TOKEN={{ renovatebot_github_token }} + {% endif %} -RENOVATE_AUTODISCOVER={{ renovatebot_autodiscover | bool | lower }} RENOVATE_ENDPOINT={{ renovatebot_endpoint }} RENOVATE_GIT_AUTHOR={{ renovatebot_git_author }} RENOVATE_PLATFORM={{ renovatebot_platform }} RENOVATE_TOKEN={{ renovatebot_token }} + +RENOVATE_AUTODISCOVER={{ renovatebot_autodiscover | bool | lower }} +{% if renovatebot_autodiscover | bool %} +{% if renovatebot_autodiscover_filter is defined %} +RENOVATE_AUTODISCOVER_FILTER={{ renovatebot_autodiscover_filter }} +{% endif %} +{% elif renovatebot_repositories | length > 0 %} +RENOVATE_REPOSITORIES={{ renovatebot_repositories | to_json }} +{% endif %}