0

In order to successfully install something I need the add-apt-repository command, which happens to be inside python-software-properties on some distros or on common-software-properties.

That is the easiest way to write .sls file that will do this and install one of these packages.

sorin
  • 161,544
  • 178
  • 535
  • 806

1 Answers1

2

Use jinja conditionals and minion grains.

The following assumes I got the pairing correct for RedHat

add-apt-repository:
  pkgs.installed:
    - pkgs:
      {% if grains['os_family'] == 'RedHat' %}
      - common-software-properties
      {% elif grains['os_family'] == 'Debian' %}
      - python-software-properties
      {% endif %}
Dan Garthwaite
  • 3,436
  • 4
  • 22
  • 32