saltstack-formulas / mongodb-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
31 stars 121 forks source link

fix installation on debian #52 #53

Closed mipapo closed 5 years ago

mipapo commented 5 years ago

This should fix #52

mipapo commented 5 years ago

Seems it' not the full solution... still getting "is invalid for APT"

aboe76 commented 5 years ago

@mipapo that's because of_family value for "ubuntu" and "debian" is debian

aboe76 commented 5 years ago

The following could work:

    {%- if grains.os in ('Debian',) %}

      name: 'deb http://repo.mongodb.org/apt/{{ os }} {{ codename }}/mongodb-org/RELEASE {{ comp or '' }}'
      file: /etc/apt/sources.list.d/mongodb-org-RELEASE.list
      keyid: 9DA31620334BD75D9DCB49F368818C72E52529D4
      keyserver: hkp://keyserver.ubuntu.com:80

    {% elif grains.os in ('Ubuntu',) %}
      name: 'deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/{{ os }} {{ codename }}/mongodb-org/RELEASE {{ comp or '' }}'
      file: /etc/apt/sources.list.d/mongodb-org-RELEASE.list
      keyid: 9DA31620334BD75D9DCB49F368818C72E52529D4
      keyserver: hkp://keyserver.ubuntu.com:80

    {%- elif grains.os_family in ('RedHat') %}

      baseurl: 'https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/RELEASE/$basearch/'
      name: mongodb-org-RELEASE
      humanname: MongoDB RELEASE Repository
      gpgkey: 'https://www.mongodb.org/static/pgp/server-RELEASE.asc'

    {%- endif %}