Skip to content

Commit

Permalink
feat(opensuse): optional openSUSE devel repository
Browse files Browse the repository at this point in the history
* fix(opensuse): update to openSUSE Leap >= 15.4

Signed-off-by: Georg Pfuetzenreuter <[email protected]>

* 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 <[email protected]>

* fix(opensuse): pkgrepo.absent TypeError

Repository can only be removed by name, other fields cause del_repo() to
fail.

Signed-off-by: Georg Pfuetzenreuter <[email protected]>

---------

Signed-off-by: Georg Pfuetzenreuter <[email protected]>
  • Loading branch information
tacerus authored May 9, 2023
1 parent 982705f commit 094bde5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion nginx/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
'server_use_symlink': False,
'pid_file': '/run/nginx.pid',
'gpg_check': True,
'gpg_key': 'http://download.opensuse.org/repositories/server:/http/openSUSE_{{ grains.osrelease }}/repodata/repomd.xml.key',
'gpg_key': 'http://download.opensuse.org/repositories/server:/http/{{ grains.osrelease }}/repodata/repomd.xml.key',
'gpg_autoimport': True,
'openssl_package': 'openssl',
},
'Arch': {
Expand Down Expand Up @@ -115,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',
Expand Down
22 changes: 16 additions & 6 deletions nginx/pkg.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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' %}
Expand Down Expand Up @@ -136,18 +145,19 @@ nginx_phusionpassenger_repo:
{% if grains.os_family == 'Suse' or grains.os == 'SUSE' %}
nginx_zypp_repo:
pkgrepo:
{%- if from_official %}
- managed
{%- else %}
- absent
{%- endif %}
- name: server_http
{%- if from_opensuse_devel %}
- managed
- humanname: server_http
- baseurl: 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/'
- baseurl: 'http://download.opensuse.org/repositories/server:/http/{{ grains.osrelease }}/'
- enabled: True
- autorefresh: True
- gpgcheck: {{ nginx.lookup.gpg_check }}
- gpgkey: {{ nginx.lookup.gpg_key }}
- gpgautoimport: {{ nginx.lookup.gpg_autoimport }}
{%- else %}
- absent
{%- endif %}
- require_in:
- pkg: nginx_install
- watch_in:
Expand Down
4 changes: 4 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down

0 comments on commit 094bde5

Please sign in to comment.