Skip to content

Commit 0d1adbc

Browse files
committed
fix(package.install): proper package for CentOS and Rocky Linux 8
fixes saltstack-formulas#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
1 parent b88246c commit 0d1adbc

File tree

3 files changed

+89
-10
lines changed

3 files changed

+89
-10
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,31 @@ repos:
1717
stages: [manual]
1818
additional_dependencies: ['@commitlint/[email protected]']
1919
always_run: true
20-
- repo: https://github.com/adithyabsk/mirrors-rubocop
21-
rev: v0.91.0
20+
- repo: https://github.com/rubocop-hq/rubocop
21+
rev: v1.25.1
2222
hooks:
2323
- id: rubocop
2424
name: Check Ruby files with rubocop
2525
args: [--debug]
2626
always_run: true
2727
pass_filenames: false
28-
- repo: https://github.com/jumanjihouse/pre-commit-hooks
29-
rev: 2.1.3
28+
- repo: https://github.com/shellcheck-py/shellcheck-py
29+
rev: v0.8.0.4
3030
hooks:
3131
- id: shellcheck
3232
name: Check shell scripts with shellcheck
3333
files: ^.*\.(sh|bash|ksh)$
3434
types: []
35-
args: []
36-
- repo: https://github.com/adrienverge/yamllint.git
37-
rev: v1.23.0
35+
- repo: https://github.com/adrienverge/yamllint
36+
rev: v1.26.3
3837
hooks:
3938
- id: yamllint
4039
name: Check YAML syntax with yamllint
4140
args: [--strict, '.']
4241
always_run: true
4342
pass_filenames: false
4443
- repo: https://github.com/warpnet/salt-lint
45-
rev: v0.3.0
44+
rev: v0.8.0
4645
hooks:
4746
- id: salt-lint
4847
name: Check Salt files using salt-lint
@@ -53,4 +52,16 @@ repos:
5352
- id: rstcheck
5453
name: Check reST files using rstcheck
5554
exclude: 'docs/CHANGELOG.rst'
56-
args: [--report=warning]
55+
- repo: https://github.com/saltstack-formulas/mirrors-rst-lint
56+
rev: v1.3.2
57+
hooks:
58+
- id: rst-lint
59+
name: Check reST files using rst-lint
60+
exclude: |
61+
(?x)^(
62+
docs/CHANGELOG.rst|
63+
docs/TOFS_pattern.rst|
64+
docs/CONTRIBUTING_DOCS.rst|
65+
docs/index.rst|
66+
)$
67+
additional_dependencies: [pygments==2.9.0]

wireguard/osfingermap.yaml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,59 @@ Fedora-31: {}
2424
Fedora-30: {}
2525

2626
# os: CentOS
27-
CentOS Linux-8: {}
27+
CentOS Linux-8:
28+
service:
29+
name: wg-quick
30+
pkg:
31+
repos:
32+
epel:
33+
humanname: Extra Packages for Enterprise Linux 8 - $basearch
34+
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
35+
enabled: 1
36+
gpgcheck: 1
37+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
38+
elrepo:
39+
humanname: ELRepo.org Community Enterprise Linux Repository - el8
40+
mirrorlist: http://mirrors.elrepo.org/mirrors-elrepo.el8
41+
enabled: 1
42+
gpgcheck: 1
43+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
44+
pkgs:
45+
wireguard-tools:
46+
fromrepo: epel
47+
kmod-wireguard:
48+
fromrepo: elrepo
49+
2850
CentOS Linux-7: {}
2951
CentOS-6:
3052
pkg:
3153
name: wireguard-centos-6
3254
config: /etc/wireguard.d/custom-centos-6.conf
3355

56+
# os: Rocky
57+
Rocky Linux-8:
58+
service:
59+
name: wg-quick
60+
pkg:
61+
repos:
62+
epel:
63+
humanname: Extra Packages for Enterprise Linux 8 - $basearch
64+
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
65+
enabled: 1
66+
gpgcheck: 1
67+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
68+
elrepo:
69+
humanname: ELRepo.org Community Enterprise Linux Repository - el8
70+
mirrorlist: http://mirrors.elrepo.org/mirrors-elrepo.el8
71+
enabled: 1
72+
gpgcheck: 1
73+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
74+
pkgs:
75+
wireguard-tools:
76+
fromrepo: epel
77+
kmod-wireguard:
78+
fromrepo: elrepo
79+
3480
# os: Amazon
3581
Amazon Linux-2: {}
3682
Amazon Linux AMI-2018: {}

wireguard/package/install.sls

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@
55
{%- set tplroot = tpldir.split('/')[0] %}
66
{%- from tplroot ~ "/map.jinja" import wireguard with context %}
77
8+
{%- for repo_name, repo in wireguard.pkg.repos.items() %}
9+
wireguard-package-install-repo-{{ repo_name }}:
10+
pkgrepo.managed:
11+
- name: {{ repo_name }}
12+
{%- for key, value in repo.items() %}
13+
- {{ key }}: {{ value }}
14+
{%- endfor %}
15+
{%- endfor %}
16+
17+
{%- if wireguard.pkg.pkgs|length > 0 %}
18+
{%- for pkg_name, pkg in wireguard.pkg.pkgs.items() %}
19+
wireguard-package-install-pkg-{{ pkg_name }}-installed:
20+
pkg.installed:
21+
- name: {{ pkg_name }}
22+
{%- if pkg.fromrepo is defined %}
23+
- fromrepo: {{ pkg.fromrepo }}
24+
- require:
25+
- pkgrepo: wireguard-package-install-repo-{{ pkg.fromrepo }}
26+
{%- endif %}
27+
{%- endfor %}
28+
{%- else %}
829
wireguard-package-install-pkg-installed:
930
pkg.installed:
1031
- name: {{ wireguard.pkg.name }}
32+
{%- endif %}

0 commit comments

Comments
 (0)