Skip to content

Commit f13db25

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

File tree

4 files changed

+99
-10
lines changed

4 files changed

+99
-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/defaults.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
wireguard:
55
pkg:
66
name: wireguard
7+
pkgs: {}
8+
repos: {}
79
rootgroup: root
810
config: '/etc/wireguard'
911
service:

wireguard/osfingermap.yaml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,63 @@ 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: |-
35+
https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&
36+
infra=$infra&content=$contentdir
37+
enabled: 1
38+
gpgcheck: 1
39+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
40+
elrepo:
41+
humanname: ELRepo.org Community Enterprise Linux Repository - el8
42+
mirrorlist: http://mirrors.elrepo.org/mirrors-elrepo.el8
43+
enabled: 1
44+
gpgcheck: 1
45+
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
46+
pkgs:
47+
wireguard-tools:
48+
fromrepo: epel
49+
kmod-wireguard:
50+
fromrepo: elrepo
51+
2852
CentOS Linux-7: {}
2953
CentOS-6:
3054
pkg:
3155
name: wireguard-centos-6
3256
config: /etc/wireguard.d/custom-centos-6.conf
3357

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

wireguard/package/install.sls

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,32 @@
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+
{%- if value is string %}
14+
- {{ key }}: {{ value | replace('\n', '') }}
15+
{%- else %}
16+
- {{ key }}: {{ value }}
17+
{%- endif %}
18+
{%- endfor %}
19+
{%- endfor %}
20+
21+
{%- if wireguard.pkg.pkgs|length > 0 %}
22+
{%- for pkg_name, pkg in wireguard.pkg.pkgs.items() %}
23+
wireguard-package-install-pkg-{{ pkg_name }}-installed:
24+
pkg.installed:
25+
- name: {{ pkg_name }}
26+
{%- if pkg.fromrepo is defined %}
27+
- fromrepo: {{ pkg.fromrepo }}
28+
- require:
29+
- pkgrepo: wireguard-package-install-repo-{{ pkg.fromrepo }}
30+
{%- endif %}
31+
{%- endfor %}
32+
{%- else %}
833
wireguard-package-install-pkg-installed:
934
pkg.installed:
1035
- name: {{ wireguard.pkg.name }}
36+
{%- endif %}

0 commit comments

Comments
 (0)