Commit 05a19532 authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Install lsb-release when deploying SlapOS in SLE.

The `lsb_release` command is required in order to run the playbook,
because it uses `ansible_lsb`.
Otherwise, the following error is raised:

```
fatal: [127.0.0.1]: FAILED! => {"msg": "The conditional check '(ansible_distribution == \"Ubuntu\" and ansible_distribution_version == \"20.04\") or (ansible_lsb.codename == \"kylin\" and ansible_lsb.major_release == \"v10\")' failed. The error was: error while evaluating conditional ((ansible_distribution == \"Ubuntu\" and ansible_distribution_version == \"20.04\") or (ansible_lsb.codename == \"kylin\" and ansible_lsb.major_release == \"v10\")): 'dict object' has no attribute 'codename'. 'dict object' has no attribute 'codename'\n\nThe error appears to be in '/tmp/tmpplaybook_unstableslapos.27149/roles/repository/tasks/main.yml': line 91, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: Install Ubuntu 20.04 repository key\n    ^ here\n"}
```

As the package containing `lsb_release` is different on different Linux
distros, this commit only attempts to install it in SLE 16 SP6, where
it is called `lsb-release`.
parent 809b425d
...@@ -55,6 +55,12 @@ is_package_installed unzip || install_package unzip ...@@ -55,6 +55,12 @@ is_package_installed unzip || install_package unzip
is_package_installed openssl || install_package openssl is_package_installed openssl || install_package openssl
is_package_installed ansible || install_package ansible is_package_installed ansible || install_package ansible
# lsb_release is required by the playbook, in order to use ansible_lsb.
# In SLE it is not installed by default, but available in the lsb-release package.
if [[ $DISTRO = sle15.6 ]]; then
is_package_installed lsb-release || install_package lsb-release
fi
if [[ $DISTRO = sle15.6 ]]; then if [[ $DISTRO = sle15.6 ]]; then
# Python 3.11 is in a separate module, called Python 3, while the base system has Python 3.6. # Python 3.11 is in a separate module, called Python 3, while the base system has Python 3.6.
# If the Python 3 module is enabled, we assume that the user has preference for it. # If the Python 3 module is enabled, we assume that the user has preference for it.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment