Fix for changes in clearlinux (#49344)
* Fix for changes in clearlinux
clearlinux is now providing /etc/os-release file and ansible is identifying as NA
then this change allow ansible to find it
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
* Add changelog fragment for clearlinux changes
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
(cherry picked from commit 6d42c5020a
)
This commit is contained in:
parent
e0f910abcb
commit
1af07cc38f
3 changed files with 39 additions and 23 deletions
3
changelogs/fragments/clear_system_variablse.yml
Normal file
3
changelogs/fragments/clear_system_variablse.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- Change the position to search os-release since clearlinux new versions are providing /etc/os-release too
|
|
@ -74,9 +74,9 @@ class DistributionFiles:
|
||||||
{'path': '/etc/lsb-release', 'name': 'Debian'},
|
{'path': '/etc/lsb-release', 'name': 'Debian'},
|
||||||
{'path': '/etc/lsb-release', 'name': 'Mandriva'},
|
{'path': '/etc/lsb-release', 'name': 'Mandriva'},
|
||||||
{'path': '/etc/sourcemage-release', 'name': 'SMGL'},
|
{'path': '/etc/sourcemage-release', 'name': 'SMGL'},
|
||||||
|
{'path': '/usr/lib/os-release', 'name': 'ClearLinux'},
|
||||||
{'path': '/etc/os-release', 'name': 'NA'},
|
{'path': '/etc/os-release', 'name': 'NA'},
|
||||||
{'path': '/etc/coreos/update.conf', 'name': 'Coreos'},
|
{'path': '/etc/coreos/update.conf', 'name': 'Coreos'},
|
||||||
{'path': '/usr/lib/os-release', 'name': 'ClearLinux'},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SEARCH_STRING = {
|
SEARCH_STRING = {
|
||||||
|
@ -405,9 +405,9 @@ class Distribution(object):
|
||||||
{'path': '/etc/lsb-release', 'name': 'Mandriva'},
|
{'path': '/etc/lsb-release', 'name': 'Mandriva'},
|
||||||
{'path': '/etc/altlinux-release', 'name': 'Altlinux'},
|
{'path': '/etc/altlinux-release', 'name': 'Altlinux'},
|
||||||
{'path': '/etc/sourcemage-release', 'name': 'SMGL'},
|
{'path': '/etc/sourcemage-release', 'name': 'SMGL'},
|
||||||
|
{'path': '/usr/lib/os-release', 'name': 'ClearLinux'},
|
||||||
{'path': '/etc/os-release', 'name': 'NA'},
|
{'path': '/etc/os-release', 'name': 'NA'},
|
||||||
{'path': '/etc/coreos/update.conf', 'name': 'Coreos'},
|
{'path': '/etc/coreos/update.conf', 'name': 'Coreos'},
|
||||||
{'path': '/usr/lib/os-release', 'name': 'ClearLinux'},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SEARCH_STRING = {
|
SEARCH_STRING = {
|
||||||
|
|
|
@ -912,36 +912,49 @@ DISTRIB_DESCRIPTION="CoreOS 976.0.0 (Coeur Rouge)"
|
||||||
},
|
},
|
||||||
|
|
||||||
# ClearLinux https://github.com/ansible/ansible/issues/31501#issuecomment-340861535
|
# ClearLinux https://github.com/ansible/ansible/issues/31501#issuecomment-340861535
|
||||||
{
|
{
|
||||||
"platform.dist": [
|
"platform.dist": [
|
||||||
"Clear Linux OS for Intel Architecture",
|
"Clear Linux OS",
|
||||||
"18450",
|
"26580",
|
||||||
"clear-linux-os"
|
"clear-linux-os"
|
||||||
],
|
],
|
||||||
"input": {
|
"input": {
|
||||||
"/usr/lib/os-release": '''
|
"/etc/os-release": '''
|
||||||
NAME="Clear Linux OS for Intel Architecture"
|
NAME="Clear Linux OS"
|
||||||
VERSION=1
|
VERSION=1
|
||||||
ID=clear-linux-os
|
ID=clear-linux-os
|
||||||
VERSION_ID=18450
|
ID_LIKE=clear-linux-os
|
||||||
PRETTY_NAME="Clear Linux OS for Intel Architecture"
|
VERSION_ID=26580
|
||||||
|
PRETTY_NAME="Clear Linux OS"
|
||||||
|
ANSI_COLOR="1;35"
|
||||||
|
HOME_URL="https://clearlinux.org"
|
||||||
|
SUPPORT_URL="https://clearlinux.org"
|
||||||
|
BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
|
||||||
|
PRIVACY_POLICY_URL="http://www.intel.com/privacy"
|
||||||
|
''',
|
||||||
|
"/usr/lib/os-release": '''
|
||||||
|
NAME="Clear Linux OS"
|
||||||
|
VERSION=1
|
||||||
|
ID=clear-linux-os
|
||||||
|
ID_LIKE=clear-linux-os
|
||||||
|
VERSION_ID=26580
|
||||||
|
PRETTY_NAME="Clear Linux OS"
|
||||||
ANSI_COLOR="1;35"
|
ANSI_COLOR="1;35"
|
||||||
HOME_URL="https://clearlinux.org"
|
HOME_URL="https://clearlinux.org"
|
||||||
SUPPORT_URL="https://clearlinux.org"
|
SUPPORT_URL="https://clearlinux.org"
|
||||||
BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
|
BUG_REPORT_URL="mailto:dev@lists.clearlinux.org"
|
||||||
PRIVACY_POLICY_URL="http://www.intel.com/privacy"
|
PRIVACY_POLICY_URL="http://www.intel.com/privacy"
|
||||||
'''
|
'''
|
||||||
},
|
|
||||||
"name": "Clear Linux OS for Intel Architecture 1",
|
|
||||||
"result": {
|
|
||||||
"distribution_release": "clear-linux-os",
|
|
||||||
"distribution": "ClearLinux",
|
|
||||||
"distribution_major_version": "18450",
|
|
||||||
"os_family": "ClearLinux",
|
|
||||||
"distribution_version": "18450"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
"name": "ClearLinux 26580",
|
||||||
|
"result": {
|
||||||
|
"distribution_release": "clear-linux-os",
|
||||||
|
"distribution": "ClearLinux",
|
||||||
|
"distribution_major_version": "26580",
|
||||||
|
"os_family": "ClearLinux",
|
||||||
|
"distribution_version": "26580"
|
||||||
|
}
|
||||||
|
},
|
||||||
# ArchLinux with no /etc/arch-release but with a /etc/os-release with NAME=Arch Linux
|
# ArchLinux with no /etc/arch-release but with a /etc/os-release with NAME=Arch Linux
|
||||||
# The fact needs to map 'Arch Linux' to 'Archlinux' for compat with 2.3 and earlier facts
|
# The fact needs to map 'Arch Linux' to 'Archlinux' for compat with 2.3 and earlier facts
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue