fix(conditionals): wrong onlyif specification
[arvados-formula.git] / arvados / ruby / package / install.sls
1 # -*- coding: utf-8 -*-
2 # vim: ft=sls
3
4 {#- Get the `tplroot` from `tpldir` #}
5 {%- set tplroot = tpldir.split('/')[0] %}
6 {%- from tplroot ~ "/map.jinja" import arvados with context %}
7
8 {%- if arvados.ruby.manage_ruby %}
9
10   {%- if arvados.ruby.use_rvm %}
11   # Centos 7 has no python3-gnupg package, so using gpg.present
12   # will fail when it can't list the existing keys.
13   # Doing it the hard way
14 arvados-ruby-package-install-gpg-cmd-run-gpg-michal-papis:
15   cmd.run:
16     - name: /bin/gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
17     - unless:
18       - /bin/gpg --list-keys 409B6B1796C275462A1703113804BB82D39DC0E3
19
20 arvados-ruby-package-install-gpg-cmd-run-gpg-piotr-kuczynski:
21   cmd.run:
22     - name: /bin/gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
23     - unless:
24       - /bin/gpg --list-keys 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
25
26 arvados-ruby-package-install-rvm-cmd-run-curl:
27   cmd.run:
28     - name: curl -s -L http://get.rvm.io | bash -s stable
29     - unless: test -f /usr/local/rvm/bin/rvm
30     - require:
31       - cmd: arvados-ruby-package-install-gpg-cmd-run-gpg-michal-papis
32       - cmd: arvados-ruby-package-install-gpg-cmd-run-gpg-piotr-kuczynski
33
34 arvados-ruby-package-install-ruby-rvm-installed:
35   rvm.installed:
36     - name: {{ arvados.ruby.pkg }}
37     - default: true
38     - require:
39       - cmd: arvados-ruby-package-install-rvm-cmd-run-curl
40
41   {%- else %}
42
43 arvados-ruby-package-install-ruby-pkg-installed:
44   pkg.installed:
45     - name: {{ arvados.ruby.pkg }}
46   {%- endif %}
47 {%- endif %}