saltstack-formulas / bareos-formula

A Saltstack formula to install and configure Bareos
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
5 stars 12 forks source link

RedHat / rhel support #12

Closed Yoda-BZH closed 6 years ago

Yoda-BZH commented 6 years ago

Hi,

On Red Hat Enterprise Linux, links to repositories are not correct.

In repo.sls (https://github.com/saltstack-formulas/bareos-formula/blob/master/bareos/repo.sls#L5-L11), the variable grains.os returns RedHat, not RHEL :

root@salt-server:~# salt 'server-rhel' grains.get os
server-rhel:
    RedHat

So the baseurl is constructed with "RedHat".

But bareos' directories are named "RHEL" (http://download.bareos.org/bareos/release/15.2/ - http://download.bareos.org/bareos/release/15.2/RHEL_7/)

One possible fix would be :

{% if grains.os == 'Ubuntu' -%}
  {% set distro = 'x' ~ grains.os ~ '_' ~ grains.osrelease %}
{%- elif grains.os == 'Debian' %}
  {% set distro = grains.os ~ '_' ~ grains.osmajorrelease ~ '.0' %}
{%- elif grains.os == 'RedHat' %}
  {% set distro = 'RHEL' ~ '_' ~ grains.osmajorrelease %}
{%- else %}
  {% set distro = grains.os ~ '_' ~ grains.osmajorrelease %}
{%- endif %}

Thank you

Yoda-BZH commented 6 years ago

Thank you !