Skip to content

Commit

Permalink
fix(package.install): proper package for CentOS and Rocky Linux 8
Browse files Browse the repository at this point in the history
fixes #3

Squashed commit of the following:

commit f07bf84
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 19:06:29 2022 +0200

    fix(osfingermap): support CentOS 8

commit 7220f67
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:56:59 2022 +0200

    fix(osfingermap): set service name to wg-quick for Rocky Linux 8

commit aeb7ac7
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:48:57 2022 +0200

    fix(package.install): set name to pkgrepo state call

commit 311851a
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:44:47 2022 +0200

    fix(package.install): indent wireguard-package-install-pkg-{{ pkg_name }} correctly

commit 2793a10
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:41:38 2022 +0200

    fix(package.install): resolve conflicting state ID

commit 59d9982
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:40:20 2022 +0200

    fix(package.install): iterate over all pkgs instead

commit 773e53a
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:37:18 2022 +0200

    fix(package.install): support CentOS and Rocky Linux 8

commit 6e0d328
Author: Ewout van Mansom <[email protected]>
Date:   Fri May 20 18:36:19 2022 +0200

    chore(precommit): update
  • Loading branch information
emansom committed May 20, 2022
1 parent b88246c commit 6dc71d5
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 10 deletions.
29 changes: 20 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,31 @@ repos:
stages: [manual]
additional_dependencies: ['@commitlint/[email protected]']
always_run: true
- repo: https://github.com/adithyabsk/mirrors-rubocop
rev: v0.91.0
- repo: https://github.com/rubocop-hq/rubocop
rev: v1.25.1
hooks:
- id: rubocop
name: Check Ruby files with rubocop
args: [--debug]
always_run: true
pass_filenames: false
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.3
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
hooks:
- id: shellcheck
name: Check shell scripts with shellcheck
files: ^.*\.(sh|bash|ksh)$
types: []
args: []
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.23.0
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
name: Check YAML syntax with yamllint
args: [--strict, '.']
always_run: true
pass_filenames: false
- repo: https://github.com/warpnet/salt-lint
rev: v0.3.0
rev: v0.8.0
hooks:
- id: salt-lint
name: Check Salt files using salt-lint
Expand All @@ -53,4 +52,16 @@ repos:
- id: rstcheck
name: Check reST files using rstcheck
exclude: 'docs/CHANGELOG.rst'
args: [--report=warning]
- repo: https://github.com/saltstack-formulas/mirrors-rst-lint
rev: v1.3.2
hooks:
- id: rst-lint
name: Check reST files using rst-lint
exclude: |
(?x)^(
docs/CHANGELOG.rst|
docs/TOFS_pattern.rst|
docs/CONTRIBUTING_DOCS.rst|
docs/index.rst|
)$
additional_dependencies: [pygments==2.9.0]
2 changes: 2 additions & 0 deletions wireguard/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
wireguard:
pkg:
name: wireguard
pkgs: {}
repos: {}
rootgroup: root
config: '/etc/wireguard'
service:
Expand Down
48 changes: 47 additions & 1 deletion wireguard/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,59 @@ Fedora-31: {}
Fedora-30: {}

# os: CentOS
CentOS Linux-8: {}
CentOS Linux-8:
service:
name: wg-quick
pkg:
repos:
epel:
humanname: Extra Packages for Enterprise Linux 8 - $basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
enabled: 1
gpgcheck: 1
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
elrepo:
humanname: ELRepo.org Community Enterprise Linux Repository - el8
mirrorlist: http://mirrors.elrepo.org/mirrors-elrepo.el8
enabled: 1
gpgcheck: 1
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
pkgs:
wireguard-tools:
fromrepo: epel
kmod-wireguard:
fromrepo: elrepo

CentOS Linux-7: {}
CentOS-6:
pkg:
name: wireguard-centos-6
config: /etc/wireguard.d/custom-centos-6.conf

# os: Rocky
Rocky Linux-8:
service:
name: wg-quick
pkg:
repos:
epel:
humanname: Extra Packages for Enterprise Linux 8 - $basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
enabled: 1
gpgcheck: 1
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
elrepo:
humanname: ELRepo.org Community Enterprise Linux Repository - el8
mirrorlist: http://mirrors.elrepo.org/mirrors-elrepo.el8
enabled: 1
gpgcheck: 1
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
pkgs:
wireguard-tools:
fromrepo: epel
kmod-wireguard:
fromrepo: elrepo

# os: Amazon
Amazon Linux-2: {}
Amazon Linux AMI-2018: {}
Expand Down
22 changes: 22 additions & 0 deletions wireguard/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import wireguard with context %}
{%- for repo_name, repo in wireguard.pkg.repos.items() %}
wireguard-package-install-repo-{{ repo_name }}:
pkgrepo.managed:
- name: {{ repo_name }}
{%- for key, value in repo.items() %}
- {{ key }}: {{ value }}
{%- endfor %}
{%- endfor %}
{%- if wireguard.pkg.pkgs|length > 0 %}
{%- for pkg_name, pkg in wireguard.pkg.pkgs.items() %}
wireguard-package-install-pkg-{{ pkg_name }}-installed:
pkg.installed:
- name: {{ pkg_name }}
{%- if pkg.fromrepo is defined %}
- fromrepo: {{ pkg.fromrepo }}
- require:
- pkgrepo: wireguard-package-install-repo-{{ pkg.fromrepo }}
{%- endif %}
{%- endfor %}
{%- else %}
wireguard-package-install-pkg-installed:
pkg.installed:
- name: {{ wireguard.pkg.name }}
{%- endif %}

0 comments on commit 6dc71d5

Please sign in to comment.