2018-02-12 08:16:03 -03:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
2020-10-21 12:28:28 -03:00
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import packages with context %}
|
2018-02-12 08:16:03 -03:00
|
|
|
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- set req_states = packages.gems.required.states %}
|
|
|
|
{%- set req_pkgs = packages.gems.required.pkgs %}
|
|
|
|
{%- set wanted_gems = packages.gems.wanted %}
|
|
|
|
{%- set unwanted_gems = packages.gems.unwanted %}
|
|
|
|
|
|
|
|
{%- if wanted_gems or unwanted_gems %}
|
|
|
|
{%- if req_states %}
|
2019-03-10 22:47:54 -03:00
|
|
|
include:
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- for dep in req_states %}
|
2019-03-10 22:47:54 -03:00
|
|
|
- {{ dep }}
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2019-03-10 22:47:54 -03:00
|
|
|
|
2018-02-12 08:16:03 -03:00
|
|
|
### REQ PKGS (without these, some of the WANTED GEMS will fail to install)
|
|
|
|
gem_req_pkgs:
|
|
|
|
pkg.installed:
|
2019-03-05 20:12:25 -03:00
|
|
|
- pkgs: {{ req_pkgs | json }}
|
2019-06-24 12:21:47 +01:00
|
|
|
- retry: {{ packages.retry_options|json }}
|
2018-02-12 08:16:03 -03:00
|
|
|
|
|
|
|
### GEMS to install
|
|
|
|
# (requires the ruby/rubygem deb/rpm installed, either by the system or listed in
|
|
|
|
# the required packages
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- for gm in wanted_gems %}
|
2018-02-12 08:16:03 -03:00
|
|
|
{{ gm }}:
|
|
|
|
gem.installed:
|
|
|
|
- require:
|
|
|
|
- pkg: gem_req_pkgs
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- if req_states %}
|
|
|
|
{%- for dep in req_states %}
|
2018-02-12 08:16:03 -03:00
|
|
|
- sls: {{ dep }}
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2019-06-24 12:21:47 +01:00
|
|
|
- retry: {{ packages.retry_options|json }}
|
2019-12-08 04:24:06 +00:00
|
|
|
{#- Not specific to Arch but needed for the newest versions of Ruby #}
|
|
|
|
{%- if grains.os_family == 'Arch' %}
|
|
|
|
- rdoc: True
|
|
|
|
- ri: True
|
|
|
|
{%- endif %}
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- endfor %}
|
2018-02-12 08:16:03 -03:00
|
|
|
|
2020-10-21 12:28:28 -03:00
|
|
|
{%- for ugm in unwanted_gems %}
|
2018-02-12 08:16:03 -03:00
|
|
|
{{ ugm }}:
|
2020-10-21 12:28:28 -03:00
|
|
|
gem.removed:
|
|
|
|
- require:
|
|
|
|
- pkg: gem_req_pkgs
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|