Commit ef1afcb
Debian 11: fix typo in
tl;dr `$::operatingsystemrelease` is different from
`$::operatingsystemmajrelease`. `$::operatingsystemmajrelease` returns
'11.0' on Debian 11, whereas `$::operatingsystemmajrelease` is `11`.
In addition `versioncmp()` says that `'11.0'` is greater than `11`.
Without this change, the module sets the default PHP version on Debian
11 to 7.2, but the actual default in Debian is 7.4:
* https://packages.debian.org/bullseye/php
The 7.2 currently comes from the default entry in the selector
statement:
* https://github.com/puppetlabs/puppetlabs-apache/blob/main/manifests/params.pp#L401
To test:
```puppet
notify { "operatingsystemrelease compared to 11: ${versioncmp($::operatingsystemrelease, '11')}":}
notify { "operatingsystemmajrelease compared to 11: ${versioncmp($::operatingsystemmajrelease, '11')}":}
notify { "operatingsystemrelease: ${::operatingsystemrelease}":}
notify { "operatingsystemmajrelease: ${::operatingsystemmajrelease}":}
```
which produces:
```terminal
puppet apply test.pp
Notice: Compiled catalog for blal in environment production in 0.02 seconds
Notice: operatingsystemrelease compared to 11: 1
Notice: /Stage[main]/Main/Notify[operatingsystemrelease compared to 11: 1]/message: defined 'message' as 'operatingsystemrelease compared to 11: 1'
Notice: operatingsystemmajrelease compared to 11: 0
Notice: /Stage[main]/Main/Notify[operatingsystemmajrelease compared to 11: 0]/message: defined 'message' as 'operatingsystemmajrelease compared to 11: 0'
Notice: operatingsystemrelease: 11.0
Notice: /Stage[main]/Main/Notify[operatingsystemrelease: 11.0]/message: defined 'message' as 'operatingsystemrelease: 11.0'
Notice: operatingsystemmajrelease: 11.0
Notice: /Stage[main]/Main/Notify[operatingsystemmajrelease: 11.0]/message: defined 'message' as 'operatingsystemmajrelease: 11'
Notice: Applied catalog in 0.01 seconds
```
```terminal
:~> facter operatingsystemmajrelease
11
:~> facter operatingsystemrelease
11.0
```
The spec tests are copied from
#2181
Co-authored-by: Kienan Stewart <kienan.stewart@burntworld.ca>versioncmp() / set default php to 7.41 parent 3fff7d8 commit ef1afcb
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
71 | 94 | | |
72 | 95 | | |
73 | 96 | | |
| |||
0 commit comments