From 9ec7ed2b310f440dad7c686906a4aa135b0e384c Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Mon, 30 Jan 2023 03:45:18 +0100 Subject: [PATCH] feat(opensuse): optional openSUSE devel repository All modern openSUSE releases (Leap 15.x, Tumbleweed) ship nginx in the default repositories. The devel repository should not be used unless the user knows what they are doing. Signed-off-by: Georg Pfuetzenreuter --- nginx/map.jinja | 1 + nginx/pkg.sls | 11 ++++++++++- pillar.example | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nginx/map.jinja b/nginx/map.jinja index ef3e27a..b3beb3d 100644 --- a/nginx/map.jinja +++ b/nginx/map.jinja @@ -116,6 +116,7 @@ 'install_from_ppa': False, 'install_from_repo': False, 'install_from_phusionpassenger': False, + 'install_from_opensuse_devel': False, 'check_config_before_apply': False, 'ppa_version': 'stable', 'source_version': '1.10.0', diff --git a/nginx/pkg.sls b/nginx/pkg.sls index ce40a3f..0dea74b 100644 --- a/nginx/pkg.sls +++ b/nginx/pkg.sls @@ -11,18 +11,27 @@ {% set from_official = true %} {% set from_ppa = false %} {% set from_phusionpassenger = false %} + {% set from_opensuse_devel = false %} {% elif nginx.install_from_ppa %} {% set from_official = false %} {% set from_ppa = true %} {% set from_phusionpassenger = false %} + {% set from_opensuse_devel = false %} {% elif nginx.install_from_phusionpassenger %} {% set from_official = false %} {% set from_ppa = false %} {% set from_phusionpassenger = true %} + {% set from_opensuse_devel = false %} +{% elif nginx.install_from_opensuse_devel %} + {% set from_official = false %} + {% set from_ppa = false %} + {% set from_phusionpassenger = false %} + {% set from_opensuse_devel = true %} {% else %} {% set from_official = false %} {% set from_ppa = false %} {% set from_phusionpassenger = false %} + {% set from_opensuse_devel = false %} {%- endif %} {%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} @@ -136,7 +145,7 @@ nginx_phusionpassenger_repo: {% if grains.os_family == 'Suse' or grains.os == 'SUSE' %} nginx_zypp_repo: pkgrepo: - {%- if from_official %} + {%- if from_opensuse_devel %} - managed {%- else %} - absent diff --git a/pillar.example b/pillar.example index 7b610ef..f5e2190 100644 --- a/pillar.example +++ b/pillar.example @@ -24,6 +24,10 @@ nginx: # each build accordingly ( https://launchpad.net/~nginx ) ppa_version: 'stable' + # Use openSUSE devel (server:http) repository to install nginx. + # If not set, the server_http repository will be removed if it exists. + install_from_opensuse_devel: false + # Source install source_version: '1.10.0' source_hash: ''