Skip to content

Commit c0ca3a9

Browse files
committed
add version defaults for Debian, Ubuntu and RedHat (clones)
As discussed before there is an issue with the nginx_version. If the nginx package is not yet installed on a system the fact `nginx_version` is not set. In that case the hard coded default value of `1.16.0` is used. This change will add a default version for some operating systems via hiera data. This avoid the need to run puppet twice to get the correct configuration generated.
1 parent 071c48d commit c0ca3a9

File tree

8 files changed

+42
-0
lines changed

8 files changed

+42
-0
lines changed

data/common.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
{}

data/os/Debian/11.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.18.0'

data/os/Debian/12.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.22.1'

data/os/RedHat/8.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.14.1'

data/os/RedHat/9.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.20.1'

data/os/Ubuntu/20.04.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.18.0'

data/os/Ubuntu/22.04.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
nginx::nginx_version: '1.18.0'

hiera.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
version: 5
3+
4+
defaults: # Used for any hierarchy level that omits these keys.
5+
datadir: data # This path is relative to hiera.yaml's directory.
6+
data_hash: yaml_data # Use the built-in YAML backend.
7+
8+
hierarchy:
9+
- name: "osfamily/major release"
10+
paths:
11+
# Used to distinguish between Debian and Ubuntu
12+
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
13+
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
14+
# Used for Solaris
15+
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
16+
- name: "osfamily"
17+
paths:
18+
- "os/%{facts.os.name}.yaml"
19+
- "os/%{facts.os.family}.yaml"
20+
- name: 'common'
21+
path: 'common.yaml'

0 commit comments

Comments
 (0)