feat(components): add submodules and tests
authorJavier Bértoli <javier@netmanagers.com.ar>
Sun, 26 Apr 2020 13:25:38 +0000 (10:25 -0300)
committerJavier Bértoli <javier@netmanagers.com.ar>
Mon, 27 Apr 2020 18:07:56 +0000 (15:07 -0300)
available components' states:

* api
* config
* controller
* keepproxy
* keepstore
* keepweb
* repo
* shell
* websocket
* workbench
* workbench2

added documentation and tests

147 files changed:
.rubocop.yml
.travis.yml
.yamllint
FORMULA
arvados/api/clean.sls [new file with mode: 0644]
arvados/api/init.sls [new file with mode: 0644]
arvados/api/package/clean.sls [new file with mode: 0644]
arvados/api/package/init.sls [moved from arvados/package/init.sls with 100% similarity]
arvados/api/package/install.sls [new file with mode: 0644]
arvados/api/service/clean.sls [moved from arvados/service/clean.sls with 70% similarity]
arvados/api/service/init.sls [moved from arvados/service/init.sls with 100% similarity]
arvados/api/service/running.sls [moved from arvados/service/running.sls with 67% similarity]
arvados/clean.sls
arvados/config/clean.sls
arvados/config/file.sls
arvados/controller/clean.sls [new file with mode: 0644]
arvados/controller/init.sls [new file with mode: 0644]
arvados/controller/package/clean.sls [new file with mode: 0644]
arvados/controller/package/init.sls [moved from arvados/subcomponent/init.sls with 78% similarity]
arvados/controller/package/install.sls [new file with mode: 0644]
arvados/controller/service/clean.sls [new file with mode: 0644]
arvados/controller/service/init.sls [moved from arvados/subcomponent/config/init.sls with 78% similarity]
arvados/controller/service/running.sls [new file with mode: 0644]
arvados/defaults.yaml
arvados/files/default/config.tmpl.jinja [new file with mode: 0644]
arvados/files/default/example.tmpl [deleted file]
arvados/files/default/example.tmpl.jinja [deleted file]
arvados/init.sls
arvados/keepproxy/clean.sls [new file with mode: 0644]
arvados/keepproxy/init.sls [new file with mode: 0644]
arvados/keepproxy/package/clean.sls [new file with mode: 0644]
arvados/keepproxy/package/init.sls [new file with mode: 0644]
arvados/keepproxy/package/install.sls [new file with mode: 0644]
arvados/keepproxy/service/clean.sls [new file with mode: 0644]
arvados/keepproxy/service/init.sls [new file with mode: 0644]
arvados/keepproxy/service/running.sls [new file with mode: 0644]
arvados/keepstore/clean.sls [new file with mode: 0644]
arvados/keepstore/init.sls [new file with mode: 0644]
arvados/keepstore/package/clean.sls [new file with mode: 0644]
arvados/keepstore/package/init.sls [new file with mode: 0644]
arvados/keepstore/package/install.sls [new file with mode: 0644]
arvados/keepstore/service/clean.sls [new file with mode: 0644]
arvados/keepstore/service/init.sls [new file with mode: 0644]
arvados/keepstore/service/running.sls [new file with mode: 0644]
arvados/keepweb/clean.sls [new file with mode: 0644]
arvados/keepweb/init.sls [new file with mode: 0644]
arvados/keepweb/package/clean.sls [new file with mode: 0644]
arvados/keepweb/package/init.sls [new file with mode: 0644]
arvados/keepweb/package/install.sls [moved from arvados/package/install.sls with 69% similarity]
arvados/keepweb/service/clean.sls [new file with mode: 0644]
arvados/keepweb/service/init.sls [new file with mode: 0644]
arvados/keepweb/service/running.sls [new file with mode: 0644]
arvados/map.jinja
arvados/osarchmap.yaml [deleted file]
arvados/osfamilymap.yaml
arvados/osfingermap.yaml [deleted file]
arvados/osmap.yaml [deleted file]
arvados/package/clean.sls [deleted file]
arvados/repo/clean.sls [new file with mode: 0644]
arvados/repo/init.sls [new file with mode: 0644]
arvados/repo/install.sls [new file with mode: 0644]
arvados/shell/clean.sls [moved from arvados/subcomponent/clean.sls with 71% similarity]
arvados/shell/init.sls [new file with mode: 0644]
arvados/shell/package/clean.sls [new file with mode: 0644]
arvados/shell/package/init.sls [new file with mode: 0644]
arvados/shell/package/install.sls [new file with mode: 0644]
arvados/subcomponent/config/clean.sls [deleted file]
arvados/subcomponent/config/file.sls [deleted file]
arvados/subcomponent/config/files/default/subcomponent-example.tmpl [deleted file]
arvados/subcomponent/config/files/default/subcomponent-example.tmpl.jinja [deleted file]
arvados/websocket/clean.sls [new file with mode: 0644]
arvados/websocket/init.sls [new file with mode: 0644]
arvados/websocket/package/clean.sls [new file with mode: 0644]
arvados/websocket/package/init.sls [new file with mode: 0644]
arvados/websocket/package/install.sls [new file with mode: 0644]
arvados/websocket/service/clean.sls [new file with mode: 0644]
arvados/websocket/service/init.sls [new file with mode: 0644]
arvados/websocket/service/running.sls [new file with mode: 0644]
arvados/workbench/clean.sls [new file with mode: 0644]
arvados/workbench/init.sls [new file with mode: 0644]
arvados/workbench/package/clean.sls [new file with mode: 0644]
arvados/workbench/package/init.sls [new file with mode: 0644]
arvados/workbench/package/install.sls [new file with mode: 0644]
arvados/workbench/service/clean.sls [new file with mode: 0644]
arvados/workbench/service/init.sls [new file with mode: 0644]
arvados/workbench/service/running.sls [new file with mode: 0644]
arvados/workbench2/clean.sls [new file with mode: 0644]
arvados/workbench2/init.sls [new file with mode: 0644]
arvados/workbench2/package/clean.sls [new file with mode: 0644]
arvados/workbench2/package/init.sls [new file with mode: 0644]
arvados/workbench2/package/install.sls [new file with mode: 0644]
docs/README.rst
kitchen.yml
pillar.example
test/integration/api/controls/config_spec.rb [new file with mode: 0644]
test/integration/api/controls/packages_spec.rb [new file with mode: 0644]
test/integration/api/controls/services_spec.rb [new file with mode: 0644]
test/integration/api/inspec.yml [new file with mode: 0644]
test/integration/controller/controls/config_spec.rb [new file with mode: 0644]
test/integration/controller/controls/packages_spec.rb [new file with mode: 0644]
test/integration/controller/controls/services_spec.rb [new file with mode: 0644]
test/integration/controller/inspec.yml [new file with mode: 0644]
test/integration/default/README.md [deleted file]
test/integration/default/controls/config_spec.rb [deleted file]
test/integration/default/controls/packages_spec.rb [deleted file]
test/integration/default/controls/services_spec.rb [deleted file]
test/integration/default/controls/subcomponent_config_spec.rb [deleted file]
test/integration/default/inspec.yml [deleted file]
test/integration/keepproxy/controls/config_spec.rb [new file with mode: 0644]
test/integration/keepproxy/controls/packages_spec.rb [new file with mode: 0644]
test/integration/keepproxy/controls/services_spec.rb [new file with mode: 0644]
test/integration/keepproxy/inspec.yml [new file with mode: 0644]
test/integration/keepstore/controls/config_spec.rb [new file with mode: 0644]
test/integration/keepstore/controls/packages_spec.rb [new file with mode: 0644]
test/integration/keepstore/controls/services_spec.rb [new file with mode: 0644]
test/integration/keepstore/inspec.yml [new file with mode: 0644]
test/integration/keepweb/controls/config_spec.rb [new file with mode: 0644]
test/integration/keepweb/controls/packages_spec.rb [new file with mode: 0644]
test/integration/keepweb/controls/services_spec.rb [new file with mode: 0644]
test/integration/keepweb/inspec.yml [new file with mode: 0644]
test/integration/repo/controls/repo_spec.rb [new file with mode: 0644]
test/integration/repo/inspec.yml [new file with mode: 0644]
test/integration/shell/controls/packages_spec.rb [new file with mode: 0644]
test/integration/shell/inspec.yml [new file with mode: 0644]
test/integration/websocket/controls/config_spec.rb [new file with mode: 0644]
test/integration/websocket/controls/packages_spec.rb [new file with mode: 0644]
test/integration/websocket/controls/services_spec.rb [new file with mode: 0644]
test/integration/websocket/inspec.yml [new file with mode: 0644]
test/integration/workbench/controls/config_spec.rb [new file with mode: 0644]
test/integration/workbench/controls/packages_spec.rb [new file with mode: 0644]
test/integration/workbench/controls/services_spec.rb [new file with mode: 0644]
test/integration/workbench/inspec.yml [new file with mode: 0644]
test/integration/workbench2/controls/config_spec.rb [new file with mode: 0644]
test/integration/workbench2/controls/packages_spec.rb [new file with mode: 0644]
test/integration/workbench2/inspec.yml [new file with mode: 0644]
test/salt/pillar/centos6.sls [deleted file]
test/salt/pillar/define_roles.sls [deleted file]
test/salt/pillar/examples/nginx_api_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_controller_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_keepproxy_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_keepweb_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_passenger.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_websocket_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_workbench2_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/nginx_workbench_configuration.sls [new file with mode: 0644]
test/salt/pillar/examples/postgresql.sls [new file with mode: 0644]
test/salt/states/example_add_snakeoil_certs/init.sls [new file with mode: 0644]

index 7c701f5eb7c3adc2e1090ebcd78570bc59159cc8..80ad7973b45b246f964d9c9beb3e6804c40ad422 100644 (file)
@@ -6,6 +6,4 @@ Layout/LineLength:
   # Increase from default of `80`
   # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
   Max: 88
   # Increase from default of `80`
   # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
   Max: 88
-
 # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
 # Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
-
index 1c233981e58f038546a2db600b1cacc3177c8599..f098e13b69bfeefdb84a3ffbcb1671de3074ccc3 100644 (file)
@@ -55,56 +55,12 @@ jobs:
                    @commitlint/travis-cli
         - commitlint-travis
 
                    @commitlint/travis-cli
         - commitlint-travis
 
-    ## Define the rest of the matrix based on Kitchen testing
-    # Make sure the instances listed below match up with
-    # the `platforms` defined in `kitchen.yml`
-    # NOTE: Please try to select up to six instances that add some meaningful
-    #       testing of the formula's behaviour. If possible, try to refrain from
-    #       the classical "chosing all the instances because I want to test on
-    #       another/all distro/s" trap: it will just add time to the testing (see
-    #       the discussion on #121).  As an example, the set chosen below covers
-    #       the most used distros families, systemd and non-systemd and the latest
-    #       three supported Saltstack versions with python2 and 3.
-    #       As for `kitchen.yml`, that should still contain all of the platforms,
-    #       to allow for comprehensive local testing
-    #       Ref: https://github.com/saltstack-formulas/template-formula/issues/118
-    #       Ref: https://github.com/saltstack-formulas/template-formula/issues/121
-    - env: INSTANCE=default-debian-10-master-py3
-    # - env: INSTANCE=default-ubuntu-1804-master-py3
-    - env: INSTANCE=default-centos-8-master-py3
-    # - env: INSTANCE=default-fedora-31-master-py3
-    # - env: INSTANCE=default-opensuse-leap-151-master-py3
-    # - env: INSTANCE=default-amazonlinux-2-master-py3
-    # - env: INSTANCE=default-arch-base-latest-master-py2
-    # - env: INSTANCE=default-debian-10-3000-1-py3
-    - env: INSTANCE=default-ubuntu-1804-3000-1-py3
-    # - env: INSTANCE=default-centos-8-3000-1-py3
-    # - env: INSTANCE=default-fedora-31-3000-1-py3
-    - env: INSTANCE=default-opensuse-leap-151-3000-1-py3
-    - env: INSTANCE=default-amazonlinux-2-3000-1-py3
-    # - env: INSTANCE=default-arch-base-latest-3000-1-py2
-    # - env: INSTANCE=default-debian-10-2019-2-py3
-    # - env: INSTANCE=default-debian-9-2019-2-py3
-    # - env: INSTANCE=default-ubuntu-1804-2019-2-py3
-    # - env: INSTANCE=default-ubuntu-1604-2019-2-py3
-    # - env: INSTANCE=default-centos-8-2019-2-py3
+    - env: INSTANCE=api-debian-10-3000-1-py3
+    - env: INSTANCE=workbench-debian-10-3000-1-py3
+    - env: INSTANCE=shell-debian-10-3000-1-py3
+    - env: INSTANCE=keepstore-debian-10-3000-1-py3
+    # - env: INSTANCE=default-ubuntu-1804-3000-1-py3
     # - env: INSTANCE=default-centos-7-2019-2-py3
     # - env: INSTANCE=default-centos-7-2019-2-py3
-    - env: INSTANCE=default-fedora-31-2019-2-py3
-    # - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
-    # - env: INSTANCE=default-amazonlinux-2-2019-2-py3
-    # - env: INSTANCE=default-ubuntu-1804-2019-2-py2
-    # - env: INSTANCE=default-amazonlinux-1-2019-2-py2
-    - env: INSTANCE=default-arch-base-latest-2019-2-py2
-    # - env: INSTANCE=default-centos-7-2018-3-py3
-    # - env: INSTANCE=default-fedora-30-2018-3-py3
-    # - env: INSTANCE=default-debian-9-2018-3-py2
-    # - env: INSTANCE=default-debian-8-2018-3-py2
-    # - env: INSTANCE=default-ubuntu-1804-2018-3-py2
-    # - env: INSTANCE=default-ubuntu-1604-2018-3-py2
-    - env: INSTANCE=centos6-centos-6-2018-3-py2
-    # - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
-    # - env: INSTANCE=default-amazonlinux-1-2018-3-py2
-    # - env: INSTANCE=default-arch-base-latest-2018-3-py2
 
     ## Define the release stage that runs `semantic-release`
     - stage: 'release'
 
     ## Define the release stage that runs `semantic-release`
     - stage: 'release'
index 740beca0481e6d2fe6903206cdca102fe8ae8bcb..8e3a23c35f4ea954dddf6acdc7c642a7930689b6 100644 (file)
--- a/.yamllint
+++ b/.yamllint
@@ -11,6 +11,7 @@ extends: default
 ignore: |
   node_modules/
   test/**/states/**/*.sls
 ignore: |
   node_modules/
   test/**/states/**/*.sls
+  test/**/pillar/**/*.sls
   .kitchen/
 
 yaml-files:
   .kitchen/
 
 yaml-files:
@@ -30,7 +31,7 @@ rules:
   line-length:
     # Increase from default of `80`
     # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
   line-length:
     # Increase from default of `80`
     # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
-    max: 88
+    max: 100
   octal-values:
     forbid-implicit-octal: true
     forbid-explicit-octal: true
   octal-values:
     forbid-implicit-octal: true
     forbid-explicit-octal: true
diff --git a/FORMULA b/FORMULA
index 91a416c0e8494218f7b50d46d9228a023e05e2c2..7ab5c3a92c7cdf8ee10e8bb06a41c09e3c79f543 100644 (file)
--- a/FORMULA
+++ b/FORMULA
@@ -1,9 +1,9 @@
 name: arvados
 name: arvados
-os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Amazon, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
-os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
-version: 1.0.0
+os: Debian, Ubuntu, RedHat, CentOS
+os_family: Debian, RedHat
+version: 0.1.0
 release: 1
 release: 1
-minimum_version: 2017.7
+minimum_version: 3000.1
 summary: arvados formula
 summary: arvados formula
-description: Formula to use as a template for other formulas
+description: Formula to install and configure an Arvados cluster
 top_level_dir: arvados
 top_level_dir: arvados
diff --git a/arvados/api/clean.sls b/arvados/api/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/api/init.sls b/arvados/api/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/api/package/clean.sls b/arvados/api/package/clean.sls
new file mode 100644 (file)
index 0000000..f1b3288
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+{% for gm in arvados.api.gem.name %}
+arvados-api-package-clean-gem-{{ gm }}-removed:
+  gem.removed:
+    - name: {{ gm }}
+    - require_in:
+      - pkg: arvados-api-package-clean-gems-deps-pkg-removed
+{% endfor %}
+
+arvados-api-package-clean-gems-deps-pkg-removed:
+  pkg.removed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+arvados-api-package-clean-pkg-removed:
+  pkg.removed:
+    - pkgs: {{ arvados.api.pkg.name | json }}
+
+arvados-api-package-clean-ruby-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
diff --git a/arvados/api/package/install.sls b/arvados/api/package/install.sls
new file mode 100644 (file)
index 0000000..5c48f0c
--- /dev/null
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+# The API server requires a valid config BEFORE installing...
+include:
+  - {{ sls_config_file }}
+
+arvados-api-package-install-ruby-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
+
+arvados-api-package-install-gems-deps-pkg-installed:
+  pkg.installed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+{% for gm in arvados.api.gem.name %}
+arvados-api-package-install-gem-{{ gm }}-installed:
+  gem.installed:
+    - name: {{ gm }}
+    - require:
+      - pkg: arvados-api-package-install-gems-deps-pkg-installed
+    - require_in:
+      - pkg: arvados-api-package-install-pkg-installed
+{% endfor %}
+
+arvados-api-package-install-pkg-installed:
+  pkg.installed:
+    - pkgs: {{ arvados.api.pkg.name | json }}
+    - require:
+      - sls: {{ sls_config_file }}
similarity index 70%
rename from arvados/service/clean.sls
rename to arvados/api/service/clean.sls
index 7dbaf1b28168a0c7f7fad45cba4f58c8f55dcc34..bd8111f79ee963551bf996a5d3915c3a12abd347 100644 (file)
@@ -5,7 +5,9 @@
 {%- set tplroot = tpldir.split('/')[0] %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
 {%- set tplroot = tpldir.split('/')[0] %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
-arvados-service-clean-service-dead:
+arvados-api-service-clean-service-dead:
   service.dead:
     - name: {{ arvados.service.name }}
     - enable: False
   service.dead:
     - name: {{ arvados.service.name }}
     - enable: False
+    - require_in:
+      - pkg: arvados-api-package-clean-pkg-removed
similarity index 67%
rename from arvados/service/running.sls
rename to arvados/api/service/running.sls
index f8dab85303390c9460882945cb7d6bdb1f78da8c..1bce157380f6116cb984e42636d9decd30d9b401 100644 (file)
@@ -7,11 +7,14 @@
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
 include:
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
 include:
+  - ..package
   - {{ sls_config_file }}
 
   - {{ sls_config_file }}
 
-arvados-service-running-service-running:
+arvados-api-service-running-service-running:
   service.running:
   service.running:
-    - name: {{ arvados.service.name }}
+    - name: {{ arvados.api.service.name }}
     - enable: True
     - watch:
       - sls: {{ sls_config_file }}
     - enable: True
     - watch:
       - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-api-package-install-pkg-installed
index 9e45fb40082dbf5d6fc8d81cb113701413662cc1..c096b7e5ed326ee2cf0e1210b34d08730e214d51 100644 (file)
@@ -2,7 +2,13 @@
 # vim: ft=sls
 
 include:
 # vim: ft=sls
 
 include:
-  - .subcomponent.clean
-  - .service.clean
   - .config.clean
   - .config.clean
-  - .package.clean
+  #- .api.clean
+  #- .keepstore.clean
+  #- .websocket.clean
+  #- .keepweb.clean
+  #- .workbench2.clean
+  #- .keepproxy.clean
+  - .shell.clean
+  #- .workbench.clean
+  - .repo.clean
index 9ed5b8af5ff6ff1b1318922f705451cf76d572a2..a9a2f0dccdba43e9f379ca685571cec36ee9d434 100644 (file)
@@ -3,14 +3,8 @@
 
 {#- Get the `tplroot` from `tpldir` #}
 {%- set tplroot = tpldir.split('/')[0] %}
 
 {#- Get the `tplroot` from `tpldir` #}
 {%- set tplroot = tpldir.split('/')[0] %}
-{%- set sls_service_clean = tplroot ~ '.service.clean' %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
-include:
-  - {{ sls_service_clean }}
-
 arvados-config-clean-file-absent:
   file.absent:
 arvados-config-clean-file-absent:
   file.absent:
-    - name: {{ arvados.config }}
-    - require:
-      - sls: {{ sls_service_clean }}
+    - name: {{ arvados.config.file }}
index 463d5b307d322495d9b7950f7158da118819f5ba..986079767889e0822676a008b6297c243c04309b 100644 (file)
@@ -3,26 +3,20 @@
 
 {#- Get the `tplroot` from `tpldir` #}
 {%- set tplroot = tpldir.split('/')[0] %}
 
 {#- Get the `tplroot` from `tpldir` #}
 {%- set tplroot = tpldir.split('/')[0] %}
-{%- set sls_package_install = tplroot ~ '.package.install' %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
 
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
 
-include:
-  - {{ sls_package_install }}
-
 arvados-config-file-file-managed:
   file.managed:
 arvados-config-file-file-managed:
   file.managed:
-    - name: {{ arvados.config }}
-    - source: {{ files_switch(['example.tmpl'],
+    - name: {{ arvados.config.file }}
+    - source: {{ files_switch(['config.tmpl', 'config.tmpl.jinja'],
                               lookup='arvados-config-file-file-managed'
                  )
               }}
                               lookup='arvados-config-file-file-managed'
                  )
               }}
-    - mode: 644
-    - user: root
-    - group: {{ arvados.rootgroup }}
+    - mode: {{ arvados.config.mode }}
+    - user: {{ arvados.config.user }}
+    - group: {{ arvados.config.group }}
     - makedirs: True
     - template: jinja
     - makedirs: True
     - template: jinja
-    - require:
-      - sls: {{ sls_package_install }}
     - context:
         arvados: {{ arvados | json }}
     - context:
         arvados: {{ arvados | json }}
diff --git a/arvados/controller/clean.sls b/arvados/controller/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/controller/init.sls b/arvados/controller/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/controller/package/clean.sls b/arvados/controller/package/clean.sls
new file mode 100644 (file)
index 0000000..29f2dbb
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-controller-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.controller.pkg.name }}
similarity index 78%
rename from arvados/subcomponent/init.sls
rename to arvados/controller/package/init.sls
index 6003be179514560dcc7f700b0234ddbd32b59ef9..d3e55181b97ee202188990c6a4adc8f15ae2f624 100644 (file)
@@ -2,4 +2,4 @@
 # vim: ft=sls
 
 include:
 # vim: ft=sls
 
 include:
-  - .config
+  - .install
diff --git a/arvados/controller/package/install.sls b/arvados/controller/package/install.sls
new file mode 100644 (file)
index 0000000..adf40b3
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-controller-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.controller.pkg.name }}
diff --git a/arvados/controller/service/clean.sls b/arvados/controller/service/clean.sls
new file mode 100644 (file)
index 0000000..cf7f817
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-controller-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-controller-package-clean-pkg-removed
similarity index 78%
rename from arvados/subcomponent/config/init.sls
rename to arvados/controller/service/init.sls
index 465ddfea497eb39bcb4db3d192c1656b9e482c37..6fe4d1a35478cf86b6a213b873cb0226ae7deae5 100644 (file)
@@ -2,4 +2,4 @@
 # vim: ft=sls
 
 include:
 # vim: ft=sls
 
 include:
-  - .file
+  - .running
diff --git a/arvados/controller/service/running.sls b/arvados/controller/service/running.sls
new file mode 100644 (file)
index 0000000..3fca8f3
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-controller-service-running-service-running:
+  service.running:
+    - name: {{ arvados.controller.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-controller-package-install-pkg-installed
index 03e860c3cb45167e97c6198b8609171bbb3bfdc2..d040cafdd54707f9df017e2a0c25256883bade62 100644 (file)
 # vim: ft=yaml
 ---
 arvados:
 # vim: ft=yaml
 ---
 arvados:
-  pkg:
-    name: arvados
-  rootgroup: root
-  config: '/etc/arvados'
-  service:
-    name: arvados
-  subcomponent:
-    config: '/etc/arvados-subcomponent-formula.conf'
-  # Just here for testing
-  added_in_defaults: defaults_value
-  winner: defaults
+  version: '2.0.2'
+  use_upstream_repo: true
+  repo:
+    humanname: Arvados Official Repository
+  ruby:
+    manage_ruby: false
+    pkg: ruby
+    manage_gems_deps: false
+    gems_deps:
+      - bundler
+      - curl
+      - g++
+      - gcc
+      - git
+      - libcurl4
+      - libcurl4-gnutls-dev
+      - libpam0g-dev
+      - libpq-dev
+      - libxml2
+      - libxml2-dev
+      - make
+      - python-dev
+      - ruby-dev
+      - zlib1g-dev
+
+  config:
+    file: /etc/arvados/config.yml
+    user: root
+    group: root
+    mode: 640
+
+  cluster:
+    database:
+      connection_pool_max: 32
+
+    tls:
+      certificate: ''
+      key: ''
+      insecure: false
+
+  ### SERVICES
+  ##### API
+  api:
+    pkg:
+      name:
+        - arvados-api-server
+    gem:
+      name:
+        - arvados-cli
+    service:
+      name: nginx
+      port: 8004
+  ##### CONTROLLER
+  controller:
+    pkg:
+      name: arvados-controller
+    service:
+      name: arvados-controller
+      port: 8003
+  ##### DISPATCHER
+  dispatcher:
+    pkg:
+      name:
+        - crunch-dispatch-local
+        # - arvados-dispatch-cloud
+        # - crunch-dispatch-slurm
+    service:
+      name: crunch-dispatch-local
+      port: 9006
+  ##### KEEPPROXY
+  keepproxy:
+    pkg:
+      name: keepproxy
+    service:
+      name: keepproxy
+      port: 25107
+  ##### KEEPWEB
+  keepweb:
+    pkg:
+      name: keep-web
+    service:
+      name: keep-web
+      # webdav
+      port: 9002
+  ##### KEEPSTORE
+  keepstore:
+    pkg:
+      name: keepstore
+    service:
+      name: keepstore
+      port: 25107
+  ##### GIT-HTTPD
+  githttpd:
+    pkg:
+      name: arvados-git-httpd
+    service:
+      name: arvados-git-httpd
+      port: 9001
+  ##### SHELL
+  shell:
+    pkg:
+      name:
+        - arvados-client
+        - arvados-src
+        - libpam-arvados
+        - python-arvados-fuse
+        - python-arvados-python-client
+        - python3-arvados-cwl-runner
+    gem:
+      name:
+        - arvados-cli
+        - arvados-login-sync
+  ##### WORKBENCH
+  workbench:
+    pkg:
+      name: arvados-workbench
+    service:
+      name: nginx
+      # just for reference, is where the upstream is configured
+      port: 9000
+  ##### WORKBENCH2
+  workbench2:
+    pkg:
+      name: arvados-workbench2
+    service:
+      name: nginx
+  #####  WEBSOCKET
+  websocket:
+    pkg:
+      name: arvados-ws
+    service:
+      name: arvados-ws
+      port: 8005
+  ##### SSO
+  sso:
+    pkg:
+      name: arvados-sso
+    service:
+      name: arvados-sso
+      port: 8900
diff --git a/arvados/files/default/config.tmpl.jinja b/arvados/files/default/config.tmpl.jinja
new file mode 100644 (file)
index 0000000..31a9665
--- /dev/null
@@ -0,0 +1,115 @@
+---
+########################################################################
+# File managed by Salt at <{{ source }}>.
+# Your changes will be overwritten.
+#
+# Please check https://doc.arvados.org/master/admin/config.html for 
+# documentation about the parameters configured here.
+########################################################################
+Clusters:
+  {{ arvados.cluster.name }}:
+    SystemRootToken: "{{ arvados.cluster.tokens.system_root }}"
+    ManagementToken: "{{ arvados.cluster.tokens.management }}"
+
+    API:
+      RailsSessionSecretToken: "{{ arvados.cluster.tokens.rails_secret }}"
+
+    Collections:
+      BlobSigningKey: "{{ arvados.cluster.secrets.blob_signing_key }}"
+      ForwardSlashNameSubstitution: "%2f"
+      DefaultReplication: 1
+      TrustAllContent: true
+
+    Login:
+      ProviderAppSecret: "{{ arvados.cluster.tokens.provider_secret }}"
+      ProviderAppID: arvados-server
+
+    Users:
+      NewUsersAreActive: true
+      AutoAdminFirstUser: true
+      AutoSetupNewUsers: true
+      AutoSetupNewUsersWithVmUUID: x2jbo-2x53u-6maueyy9if4u7vq
+      AutoSetupNewUsersWithRepository: true
+
+    TLS:
+      Certificate: "{{ arvados.cluster.tls.certificate }}"
+      Key: "{{ arvados.cluster.tls.key }}"
+      Insecure: {{ arvados.cluster.tls.insecure }}
+
+    Workbench:
+      SecretKeyBase: {{ arvados.cluster.secrets.workbench_secret_key }}
+      SiteName:  {{ arvados.cluster.name | upper }}
+
+    # FIXME!!!!
+    # Git:
+    #   GitCommand: /usr/share/gitolite3/gitolite-shell
+    #   GitoliteHome: /var/lib/arvados/git
+    #   Repositories: /var/lib/arvados/git/repositories
+
+    Volumes:
+      {% for v, p in arvados.cluster.volumes.items() -%}
+      ### {{ v | upper }}
+      {{ p.cluster }}-nyw5e-{{ p.volume_id }}:
+        Driver: {{ p.driver }}
+        DriverParameters: {{ p.driver_parameters | yaml }}
+        AccessViaHosts: {{ p.access_via_hosts | yaml }}
+        Replication: {{ p.replication }}
+      {% endfor -%}
+
+    ### DATABASE CONFIGURATION
+    PostgreSQL:
+      ConnectionPool: {{ arvados.cluster.database.connection_pool_max }}
+      Connection:
+        # All parameters here are passed to the PG client library in a connection string;
+        # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
+        dbname: {{ arvados.cluster.database.name }}
+        host: {{ arvados.cluster.database.host }}
+        password: {{ arvados.cluster.database.password }}
+        user: {{ arvados.cluster.database.user }}
+        client_encoding: {{ arvados.cluster.database.client_encoding }}
+
+    ### SERVICES URLs
+    # This could probably made into a loop, but some consistency check needs to be done
+    # on the arvados side before that's possible
+    Services:
+      # Composer: FIXME!!!
+      Controller:
+        ExternalURL: "https://{{ arvados.cluster.domain }}"
+        InternalURLs:
+          "http://localhost:{{ arvados.controller.service.port }}": {}
+      DispatchCloud:
+        InternalURLs:
+          "http://localhost:{{ arvados.dispatcher.service.port }}": {}
+      # GitSSH: FIXME!!!
+      # Health: FIXME!!!
+      # Keepbalance: FIXME!!!
+      # Keepproxy: FIXME!!!
+      # Keepstore: FIXME!!!
+      # Nodemanager: FIXME!!!
+      RailsAPI:
+        InternalURLs:
+          "http://localhost:{{ arvados.api.service.port }}": {}
+      SSO:
+        ExternalURL: "https://sso.{{ arvados.cluster.domain }}"
+      WebDAV:
+        ExternalURL: https://collections.{{ arvados.cluster.domain }}
+        InternalURLs:
+          "http://localhost:{{ arvados.keepweb.service.port }}": {}
+      WebDAVDownload:
+        ExternalURL: https://download.{{ arvados.cluster.domain }}
+      # WebShell: FIXME!!!
+      Websocket:
+        ExternalURL: wss://ws.{{ arvados.cluster.domain }}/websocket
+        InternalURLs:
+          "http://localhost:{{ arvados.websocket.service.port }}": {}
+      Workbench1:
+        ExternalURL: "https://workbench.{{ arvados.cluster.domain }}"
+      Workbench2:
+        ExternalURL: "https://workbench2.{{ arvados.cluster.domain }}"
+      Keepproxy:
+        ExternalURL: https://keep.{{ arvados.cluster.domain }}
+        InternalURLs:
+          "http://localhost:{{ arvados.keepproxy.service.port }}": {}
+      Keepstore:
+        InternalURLs:
+          "http://keep0.{{ arvados.cluster.domain }}:{{ arvados.keepstore.service.port }}/": {}
diff --git a/arvados/files/default/example.tmpl b/arvados/files/default/example.tmpl
deleted file mode 100644 (file)
index 2c9c60f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################################
-# File managed by Salt at <{{ source }}>.
-# Your changes will be overwritten.
-########################################################################
-
-This is an example file from SaltStack template-formula.
diff --git a/arvados/files/default/example.tmpl.jinja b/arvados/files/default/example.tmpl.jinja
deleted file mode 100644 (file)
index a071658..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-########################################################################
-# File managed by Salt at <{{ source }}>.
-# Your changes will be overwritten.
-########################################################################
-
-This is another example file from SaltStack template-formula.
-
-# This is here for testing purposes
-{{ arvados | json }}
-
-winner of the merge: {{ arvados['winner'] }}
index 275d1fc8999fa08c271eed0fce4ef6b9ba44ecf5..7f14f19365e3cd95bd5c3c2bbc970c857ee93d2d 100644 (file)
@@ -2,7 +2,13 @@
 # vim: ft=sls
 
 include:
 # vim: ft=sls
 
 include:
-  - .package
-  - .config
-  - .service
-  - .subcomponent
+  - .repo
+  #- .config
+  #- .api
+  #- .keepstore
+  #- .websocket
+  #- .keepweb
+  #- .workbench2
+  #- .keepproxy
+  #- .shell
+  #- .workbench
diff --git a/arvados/keepproxy/clean.sls b/arvados/keepproxy/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/keepproxy/init.sls b/arvados/keepproxy/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/keepproxy/package/clean.sls b/arvados/keepproxy/package/clean.sls
new file mode 100644 (file)
index 0000000..e90b7a0
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepproxy-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.keepproxy.pkg.name }}
diff --git a/arvados/keepproxy/package/init.sls b/arvados/keepproxy/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/keepproxy/package/install.sls b/arvados/keepproxy/package/install.sls
new file mode 100644 (file)
index 0000000..1f1713f
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepproxy-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.keepproxy.pkg.name }}
diff --git a/arvados/keepproxy/service/clean.sls b/arvados/keepproxy/service/clean.sls
new file mode 100644 (file)
index 0000000..0c3f63b
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepproxy-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-keepproxy-package-clean-pkg-removed
diff --git a/arvados/keepproxy/service/init.sls b/arvados/keepproxy/service/init.sls
new file mode 100644 (file)
index 0000000..6fe4d1a
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .running
diff --git a/arvados/keepproxy/service/running.sls b/arvados/keepproxy/service/running.sls
new file mode 100644 (file)
index 0000000..1dba517
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-keepproxy-service-running-service-running:
+  service.running:
+    - name: {{ arvados.keepproxy.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-keepproxy-package-install-pkg-installed
diff --git a/arvados/keepstore/clean.sls b/arvados/keepstore/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/keepstore/init.sls b/arvados/keepstore/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/keepstore/package/clean.sls b/arvados/keepstore/package/clean.sls
new file mode 100644 (file)
index 0000000..b751347
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepstore-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.keepstore.pkg.name }}
diff --git a/arvados/keepstore/package/init.sls b/arvados/keepstore/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/keepstore/package/install.sls b/arvados/keepstore/package/install.sls
new file mode 100644 (file)
index 0000000..90220c7
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepstore-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.keepstore.pkg.name }}
diff --git a/arvados/keepstore/service/clean.sls b/arvados/keepstore/service/clean.sls
new file mode 100644 (file)
index 0000000..a647a97
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepstore-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-keepstore-package-clean-pkg-removed
diff --git a/arvados/keepstore/service/init.sls b/arvados/keepstore/service/init.sls
new file mode 100644 (file)
index 0000000..6fe4d1a
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .running
diff --git a/arvados/keepstore/service/running.sls b/arvados/keepstore/service/running.sls
new file mode 100644 (file)
index 0000000..3cf2596
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-keepstore-service-running-service-running:
+  service.running:
+    - name: {{ arvados.keepstore.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-keepstore-package-install-pkg-installed
diff --git a/arvados/keepweb/clean.sls b/arvados/keepweb/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/keepweb/init.sls b/arvados/keepweb/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/keepweb/package/clean.sls b/arvados/keepweb/package/clean.sls
new file mode 100644 (file)
index 0000000..54adcec
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepweb-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.keepweb.pkg.name }}
diff --git a/arvados/keepweb/package/init.sls b/arvados/keepweb/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
similarity index 69%
rename from arvados/package/install.sls
rename to arvados/keepweb/package/install.sls
index 219ba17421f3fe5864051bc2bb248d4f18eb5876..c26164f7bf93f267496da735f2349540f484feab 100644 (file)
@@ -5,6 +5,6 @@
 {%- set tplroot = tpldir.split('/')[0] %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
 {%- set tplroot = tpldir.split('/')[0] %}
 {%- from tplroot ~ "/map.jinja" import arvados with context %}
 
-arvados-package-install-pkg-installed:
+arvados-keepweb-package-install-pkg-installed:
   pkg.installed:
   pkg.installed:
-    - name: {{ arvados.pkg.name }}
+    - name: {{ arvados.keepweb.pkg.name }}
diff --git a/arvados/keepweb/service/clean.sls b/arvados/keepweb/service/clean.sls
new file mode 100644 (file)
index 0000000..f0f530a
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-keepweb-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-keepweb-package-clean-pkg-removed
diff --git a/arvados/keepweb/service/init.sls b/arvados/keepweb/service/init.sls
new file mode 100644 (file)
index 0000000..6fe4d1a
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .running
diff --git a/arvados/keepweb/service/running.sls b/arvados/keepweb/service/running.sls
new file mode 100644 (file)
index 0000000..55e12ef
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-keepweb-service-running-service-running:
+  service.running:
+    - name: {{ arvados.keepweb.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-keepweb-package-install-pkg-installed
index 1479309e9fea686cc98e7a8d15d0062824504419..7ef4b339ad87ae159650e070f58bdc0c40d3c2d8 100644 (file)
@@ -5,10 +5,7 @@
 {%- set tplroot = tpldir.split('/')[0] %}
 {#- Start imports as #}
 {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
 {%- set tplroot = tpldir.split('/')[0] %}
 {#- Start imports as #}
 {%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
-{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
 {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
 {%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
-{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
-{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
 
 {#- Retrieve the config dict only once #}
 {%- set _config = salt['config.get'](tplroot, default={}) %}
 
 {#- Retrieve the config dict only once #}
 {%- set _config = salt['config.get'](tplroot, default={}) %}
       default_settings,
       default=tplroot,
       merge=salt['grains.filter_by'](
       default_settings,
       default=tplroot,
       merge=salt['grains.filter_by'](
-        osarchmap,
-        grain='osarch',
+        osfamilymap,
+        grain='os_family',
         merge=salt['grains.filter_by'](
         merge=salt['grains.filter_by'](
-          osfamilymap,
-          grain='os_family',
-          merge=salt['grains.filter_by'](
-            osmap,
-            grain='os',
-            merge=salt['grains.filter_by'](
-              osfingermap,
-              grain='osfinger',
-              merge=salt['grains.filter_by'](
-                _config,
-                default='lookup'
-              )
-            )
-          )
+          _config,
+          default='lookup'
         )
       )
     )
         )
       )
     )
     )
 %}
 
     )
 %}
 
-{#- Change **arvados** to match with your formula's name and then remove this line #}
 {%- set arvados = config %}
 {%- set arvados = config %}
-
-{#- Post-processing for specific non-YAML customisations #}
-{%- if grains.os == 'MacOS' %}
-{%-   set macos_group = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
-{%-   do arvados.update({'rootgroup': macos_group}) %}
-{%- endif %}
diff --git a/arvados/osarchmap.yaml b/arvados/osarchmap.yaml
deleted file mode 100644 (file)
index ab3bc1f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
-#
-# Setup variables using grains['osarch'] based logic.
-# You just need to add the key:values for an `osarch` that differ
-# from `defaults.yaml`.
-# Only add an `osarch` which is/will be supported by the formula.
-#
-# If you do not need to provide defaults via the `osarch` grain,
-# you will need to provide at least an empty dict in this file, e.g.
-# osarch: {}
----
-amd64:
-  arch: amd64
-
-x86_64:
-  arch: amd64
-
-386:
-  arch: 386
-
-arm64:
-  arch: arm64
-
-armv6l:
-  arch: armv6l
-
-armv7l:
-  arch: armv7l
-
-ppc64le:
-  arch: ppc64le
-
-s390x:
-  arch: s390x
index 15cbd656c4cdc10712dd3c11c0a5f76e37fcdfd9..7342b3d1d57b34bd3fd6ec980190154cb1a49885 100644 (file)
 # osfamilymap: {}
 ---
 Debian:
 # osfamilymap: {}
 ---
 Debian:
-  pkg:
-    name: arvados-debian
-  config: /etc/arvados.d/custom.conf
+  repo:
+    url_base: 'http://apt.arvados.org'
+    file: /etc/apt/sources.list.d/arvados.list
+    key_url: 'http://apt.arvados.org/pubkey.gpg'
 
 RedHat:
 
 RedHat:
-  pkg:
-    name: arvados-redhat
-  config: /etc/arvados.conf
-
-Suse:
-  pkg:
-    name: arvados-suse
-
-Gentoo: {}
-
-Arch:
-  pkg:
-    name: arvados-arch
-  service:
-    name: service-arch
-
-Alpine: {}
-
-FreeBSD:
-  rootgroup: wheel
-
-OpenBSD:
-  rootgroup: wheel
-
-Solaris: {}
-
-Windows: {}
-
-MacOS: {}
+  repo:
+    url_base: 'http://rpm.arvados.org/CentOS/$releasever/os/$basearch/'
+    file: /etc/yum.repos.d/arvados.repo
+    key_url: 'http://rpm.arvados.org/CentOS/RPM-GPG-KEY-curoverse'
diff --git a/arvados/osfingermap.yaml b/arvados/osfingermap.yaml
deleted file mode 100644 (file)
index 7cb3793..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
-#
-# Setup variables using grains['osfinger'] based logic.
-# You just need to add the key:values for an `osfinger` that differ
-# from `defaults.yaml` + `osarch.yaml` + `os_family.yaml` + `osmap.yaml`.
-# Only add an `osfinger` which is/will be supported by the formula.
-#
-# If you do not need to provide defaults via the `os_finger` grain,
-# you will need to provide at least an empty dict in this file, e.g.
-# osfingermap: {}
----
-# os: Debian
-Debian-10: {}
-Debian-9: {}
-Debian-8: {}
-
-# os: Ubuntu
-Ubuntu-18.04:
-  config: /etc/arvados.d/custom-ubuntu-18.04.conf
-Ubuntu-16.04: {}
-
-# os: Fedora
-Fedora-31: {}
-Fedora-30: {}
-
-# os: CentOS
-CentOS Linux-8: {}
-CentOS Linux-7: {}
-CentOS-6:
-  pkg:
-    name: arvados-centos-6
-  config: /etc/arvados.d/custom-centos-6.conf
-
-# os: Amazon
-Amazon Linux-2: {}
-Amazon Linux AMI-2018: {}
-
-# os: SUSE
-Leap-15: {}
-
-# os: FreeBSD
-FreeBSD-12: {}
-
-# os: Windows
-Windows-8.1: {}
-
-# os: Gentoo
-Gentoo-2: {}
diff --git a/arvados/osmap.yaml b/arvados/osmap.yaml
deleted file mode 100644 (file)
index 334eace..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
-#
-# Setup variables using grains['os'] based logic.
-# You just need to add the key:values for an `os` that differ
-# from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`.
-# Only add an `os` which is/will be supported by the formula.
-#
-# If you do not need to provide defaults via the `os` grain,
-# you will need to provide at least an empty dict in this file, e.g.
-# osmap: {}
----
-# os_family: Debian
-Ubuntu:
-  pkg:
-    name: arvados-ubuntu
-  config: /etc/arvados.d/custom-ubuntu.conf
-Raspbian: {}
-
-# os_family: RedHat
-Fedora:
-  pkg:
-    name: arvados-fedora
-  service:
-    name: service-fedora
-CentOS: {}
-Amazon: {}
-
-# os_family: Suse
-SUSE: {}
-openSUSE: {}
-
-# os_family: Gentoo
-Funtoo: {}
-
-# os_family: Arch
-Manjaro: {}
-
-# os_family: Solaris
-SmartOS: {}
diff --git a/arvados/package/clean.sls b/arvados/package/clean.sls
deleted file mode 100644 (file)
index 446459b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=sls
-
-{#- Get the `tplroot` from `tpldir` #}
-{%- set tplroot = tpldir.split('/')[0] %}
-{%- set sls_config_clean = tplroot ~ '.config.clean' %}
-{%- from tplroot ~ "/map.jinja" import arvados with context %}
-
-include:
-  - {{ sls_config_clean }}
-
-arvados-package-clean-pkg-removed:
-  pkg.removed:
-    - name: {{ arvados.pkg.name }}
-    - require:
-      - sls: {{ sls_config_clean }}
diff --git a/arvados/repo/clean.sls b/arvados/repo/clean.sls
new file mode 100644 (file)
index 0000000..85e6bcb
--- /dev/null
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+{% if arvados.use_upstream_repo -%}
+  {% if grains.get('os_family') == 'Debian' -%}
+arvados-repo-clean-repo-absent:
+  pkgrepo.absent:
+    - file: {{ arvados.repo.file }}
+    - key_url: {{ arvados.repo.key_url }}
+
+  {%- elif grains.get('os_family') == 'RedHat' %}
+arvados-repo-clean-repo-absent:
+  pkgrepo.absent:
+    - file: {{ arvados.repo.file }}
+    - gpgkey: {{ arvados.repo.gpgkey }}
+
+  {%- else %}
+arvados_repo-clean-repo-absent: {}
+  {%- endif %}
+{%- endif %}
diff --git a/arvados/repo/init.sls b/arvados/repo/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/repo/install.sls b/arvados/repo/install.sls
new file mode 100644 (file)
index 0000000..8478cd7
--- /dev/null
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+{% if arvados.use_upstream_repo -%}
+  {% if grains.get('os_family') == 'Debian' -%}
+arvados-repo-install-pkgrepo-managed:
+  pkgrepo.managed:
+    - humanname: {{ arvados.repo.humanname }}
+    - name: deb {{ arvados.repo.url_base }}/ {{ grains.get('lsb_distrib_codename') }} main
+    - file: {{ arvados.repo.file }}
+    - key_url: {{ arvados.repo.key_url }}
+
+  {%- elif grains.get('os_family') == 'RedHat' %}
+arvados-repo-install-pkgrepo-managed:
+  pkgrepo.managed:
+    - name: arvados
+    - file: {{ arvados.repo.file }}
+    - humanname: {{ arvados.repo.humanname }}
+    - baseurl: {{ arvados.repo.url_base }}
+    - gpgcheck: 1
+    - gpgkey: {{ arvados.repo.gpgkey }}
+
+  {%- else %}
+arvados-repo-install-pkgrepo-managed: {}
+  {%- endif %}
+{%- endif %}
similarity index 71%
rename from arvados/subcomponent/clean.sls
rename to arvados/shell/clean.sls
index 564769d2bd589198d2078e5a1fdc990a13a325ff..f77852d56d39dd6d05318757abee8ba2e80aa7f3 100644 (file)
@@ -2,4 +2,4 @@
 # vim: ft=sls
 
 include:
 # vim: ft=sls
 
 include:
-  - .config.clean
+  - .package.clean
diff --git a/arvados/shell/init.sls b/arvados/shell/init.sls
new file mode 100644 (file)
index 0000000..18fd41c
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
diff --git a/arvados/shell/package/clean.sls b/arvados/shell/package/clean.sls
new file mode 100644 (file)
index 0000000..edf6772
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+{% for gm in arvados.shell.gem.name %}
+arvados-shell-package-clean-gem-{{ gm }}-removed:
+  gem.removed:
+    - name: {{ gm }}
+    - require_in:
+      - pkg: arvados-shell-package-clean-gems-deps-pkg-removed
+{% endfor %}
+
+arvados-shell-package-clean-gems-deps-pkg-removed:
+  pkg.removed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+arvados-shell-package-clean-pkg-removed:
+  pkg.removed:
+    - pkgs: {{ arvados.shell.pkg.name | json }}
+
+arvados-shell-package-clean-ruby-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
diff --git a/arvados/shell/package/init.sls b/arvados/shell/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/shell/package/install.sls b/arvados/shell/package/install.sls
new file mode 100644 (file)
index 0000000..b9263f4
--- /dev/null
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-shell-package-install-pkg-installed:
+  pkg.installed:
+    - pkgs: {{ arvados.shell.pkg.name | json }}
+
+arvados-shell-package-install-ruby-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
+
+arvados-shell-package-install-gems-deps-pkg-installed:
+  pkg.installed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+{% for gm in arvados.shell.gem.name %}
+arvados-shell-package-install-gem-{{ gm }}-installed:
+  gem.installed:
+    - name: {{ gm }}
+    - require:
+      - pkg: arvados-shell-package-install-gems-deps-pkg-installed
+{% endfor %}
diff --git a/arvados/subcomponent/config/clean.sls b/arvados/subcomponent/config/clean.sls
deleted file mode 100644 (file)
index f108180..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=sls
-
-{#- Get the `tplroot` from `tpldir` #}
-{%- set tplroot = tpldir.split('/')[0] %}
-{%- set sls_service_clean = tplroot ~ '.service.clean' %}
-{%- from tplroot ~ "/map.jinja" import arvados with context %}
-
-include:
-  - {{ sls_service_clean }}
-
-arvados-subcomponent-config-clean-file-absent:
-  file.absent:
-    - name: {{ arvados.subcomponent.config }}
-    - watch_in:
-        - sls: {{ sls_service_clean }}
diff --git a/arvados/subcomponent/config/file.sls b/arvados/subcomponent/config/file.sls
deleted file mode 100644 (file)
index 251d859..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=sls
-
-{#- Get the `tplroot` from `tpldir` #}
-{%- set tplroot = tpldir.split('/')[0] %}
-{%- set sls_config_file = tplroot ~ '.config.file' %}
-{%- from tplroot ~ "/map.jinja" import arvados with context %}
-{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
-
-include:
-  - {{ sls_config_file }}
-
-arvados-subcomponent-config-file-file-managed:
-  file.managed:
-    - name: {{ arvados.subcomponent.config }}
-    - source: {{ files_switch(['subcomponent-example.tmpl'],
-                              lookup='arvados-subcomponent-config-file-file-managed',
-                              use_subpath=True
-                 )
-              }}
-    - mode: 644
-    - user: root
-    - group: {{ arvados.rootgroup }}
-    - makedirs: True
-    - template: jinja
-    - require_in:
-      - sls: {{ sls_config_file }}
diff --git a/arvados/subcomponent/config/files/default/subcomponent-example.tmpl b/arvados/subcomponent/config/files/default/subcomponent-example.tmpl
deleted file mode 100644 (file)
index 522de00..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################################
-# File managed by Salt at <{{ source }}>.
-# Your changes will be overwritten.
-########################################################################
-
-This is a subcomponent example file from SaltStack template-formula.
diff --git a/arvados/subcomponent/config/files/default/subcomponent-example.tmpl.jinja b/arvados/subcomponent/config/files/default/subcomponent-example.tmpl.jinja
deleted file mode 100644 (file)
index cbfd51d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-########################################################################
-# File managed by Salt at <{{ source }}>.
-# Your changes will be overwritten.
-########################################################################
-
-This is another subcomponent example file from SaltStack template-formula.
diff --git a/arvados/websocket/clean.sls b/arvados/websocket/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/websocket/init.sls b/arvados/websocket/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/websocket/package/clean.sls b/arvados/websocket/package/clean.sls
new file mode 100644 (file)
index 0000000..1cf8d21
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-websocket-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.websocket.pkg.name }}
diff --git a/arvados/websocket/package/init.sls b/arvados/websocket/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/websocket/package/install.sls b/arvados/websocket/package/install.sls
new file mode 100644 (file)
index 0000000..94cebc2
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-websocket-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.websocket.pkg.name }}
diff --git a/arvados/websocket/service/clean.sls b/arvados/websocket/service/clean.sls
new file mode 100644 (file)
index 0000000..b8010cf
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-websocket-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-websocket-package-clean-pkg-removed
diff --git a/arvados/websocket/service/init.sls b/arvados/websocket/service/init.sls
new file mode 100644 (file)
index 0000000..6fe4d1a
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .running
diff --git a/arvados/websocket/service/running.sls b/arvados/websocket/service/running.sls
new file mode 100644 (file)
index 0000000..5e8098a
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-websocket-service-running-service-running:
+  service.running:
+    - name: {{ arvados.websocket.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-websocket-package-install-pkg-installed
diff --git a/arvados/workbench/clean.sls b/arvados/workbench/clean.sls
new file mode 100644 (file)
index 0000000..29d9c4c
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .service.dead
+  - .package.clean
diff --git a/arvados/workbench/init.sls b/arvados/workbench/init.sls
new file mode 100644 (file)
index 0000000..02a98b8
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
+  - .service
diff --git a/arvados/workbench/package/clean.sls b/arvados/workbench/package/clean.sls
new file mode 100644 (file)
index 0000000..3d7af2f
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-workbench-package-clean-gems-deps-pkg-removed:
+  pkg.removed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+arvados-workbench-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.workbench.pkg.name }}
+
+arvados-workbench-package-clean-ruby-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
diff --git a/arvados/workbench/package/init.sls b/arvados/workbench/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/workbench/package/install.sls b/arvados/workbench/package/install.sls
new file mode 100644 (file)
index 0000000..e6deefe
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+# The API server requires a valid config BEFORE installing...
+include:
+  - {{ sls_config_file }}
+
+arvados-workbench-package-install-ruby-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.ruby.pkg }}
+    - only_if: {{ arvados.ruby.manage_ruby }}
+
+arvados-workbench-package-install-gems-deps-pkg-installed:
+  pkg.installed:
+    - pkgs: {{ arvados.ruby.gems_deps | json }}
+    - only_if: {{ arvados.ruby.manage_gems_deps }}
+
+arvados-workbench-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.workbench.pkg.name }}
+    - require:
+      - sls: {{ sls_config_file }}
diff --git a/arvados/workbench/service/clean.sls b/arvados/workbench/service/clean.sls
new file mode 100644 (file)
index 0000000..5f5e14e
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-workbench-service-clean-service-dead:
+  service.dead:
+    - name: {{ arvados.service.name }}
+    - enable: False
+    - require_in:
+      - pkg: arvados-workbench-package-clean-pkg-removed
diff --git a/arvados/workbench/service/init.sls b/arvados/workbench/service/init.sls
new file mode 100644 (file)
index 0000000..6fe4d1a
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .running
diff --git a/arvados/workbench/service/running.sls b/arvados/workbench/service/running.sls
new file mode 100644 (file)
index 0000000..a91dbff
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+include:
+  - ..package
+  - {{ sls_config_file }}
+
+arvados-workbench-service-running-service-running:
+  service.running:
+    - name: {{ arvados.workbench.service.name }}
+    - enable: True
+    - watch:
+      - sls: {{ sls_config_file }}
+    - require:
+      - pkg: arvados-workbench-package-install-pkg-installed
diff --git a/arvados/workbench2/clean.sls b/arvados/workbench2/clean.sls
new file mode 100644 (file)
index 0000000..f77852d
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package.clean
diff --git a/arvados/workbench2/init.sls b/arvados/workbench2/init.sls
new file mode 100644 (file)
index 0000000..292b919
--- /dev/null
@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .package
+  - ..config
diff --git a/arvados/workbench2/package/clean.sls b/arvados/workbench2/package/clean.sls
new file mode 100644 (file)
index 0000000..bf9cb58
--- /dev/null
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-workbench2-package-clean-pkg-removed:
+  pkg.removed:
+    - name: {{ arvados.workbench2.pkg.name }}
diff --git a/arvados/workbench2/package/init.sls b/arvados/workbench2/package/init.sls
new file mode 100644 (file)
index 0000000..d3e5518
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+  - .install
diff --git a/arvados/workbench2/package/install.sls b/arvados/workbench2/package/install.sls
new file mode 100644 (file)
index 0000000..8aa27e6
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+{#- Get the `tplroot` from `tpldir` #}
+{%- set tplroot = tpldir.split('/')[0] %}
+{%- set sls_config_file = tplroot ~ '.config.file' %}
+{%- from tplroot ~ "/map.jinja" import arvados with context %}
+
+arvados-workbench2-package-install-pkg-installed:
+  pkg.installed:
+    - name: {{ arvados.workbench2.pkg.name }}
+    - require:
+      - sls: {{ sls_config_file }}
index 0d5918aafd86aae4c4241d182c7703759bdfe4ed..6f675b7d602fea80a75620f19098febc3f52d87b 100644 (file)
@@ -14,8 +14,7 @@ arvados-formula
    :scale: 100%
    :target: https://github.com/semantic-release/semantic-release
 
    :scale: 100%
    :target: https://github.com/semantic-release/semantic-release
 
-A SaltStack formula that is empty. It has dummy content to help with a quick
-start on a new formula and it serves as a style guide.
+A SaltStack formula to install and configure an `Arvados cluster <https://arvados.org>`_.
 
 .. contents:: **Table of Contents**
 
 
 .. contents:: **Table of Contents**
 
@@ -45,7 +44,21 @@ Please see `How to contribute <https://github.com/saltstack-formulas/.github/blo
 Special notes
 -------------
 
 Special notes
 -------------
 
-None
+Arvados **requires** a Postgres database for its API server and SSL for communications. If you don't satisfy these two requirements, things
+won't work. It also uses an Nginx server as a redirector but probably almost any other webserver/redirector can be used instead.
+
+We suggest you use the `postgres-formula <https://github.com/saltstack-formulas/postgres-formula/>`_,
+the `nginx-formula <https://github.com/saltstack-formulas/nginx-formula/>`_ and the
+`letsencrypt-formula <https://github.com/saltstack-formulas/letsencrypt-formula/>`_ to install satisfy these dependencies.
+In the FIXME directory there are some example pillar YAMLs to set up these packages as Arvados needs it.
+
+Also, please note that the individual subcomponents `clean` states **won't remove the config**: as the config is common to all the suite
+components and they can be installed in the same host, removing it with a subcomponent might break others.
+
+If you want to remove the config in a host where you're removing a subcomponent, use the `arvados.config.clean` state after the
+`arvados.<subcomponent>.clean` state.
+
+The `arvados.clean` state will remove everything, config included, and can be used in any host to remove all of arvados files.
 
 Available states
 ----------------
 
 Available states
 ----------------
@@ -58,36 +71,81 @@ Available states
 
 *Meta-state (This is a state that includes other states)*.
 
 
 *Meta-state (This is a state that includes other states)*.
 
-This installs the arvados package,
+This installs the WHOLE arvados suite in a single host,
 manages the arvados configuration file and then
 manages the arvados configuration file and then
-starts the associated arvados service.
+starts the associated arvados services.
 
 
-``arvados.package``
-^^^^^^^^^^^^^^^^^^^^
+``arvados.clean``
+^^^^^^^^^^^^^^^^^^
+
+*Meta-state (This is a state that includes other states)*.
 
 
-This state will install the arvados package only.
+this state will undo everything performed in the ``arvados`` meta-state in reverse order, i.e.
+stops the services, removes the configuration file and then uninstalls the packages.
 
 ``arvados.config``
 ^^^^^^^^^^^^^^^^^^^
 
 
 ``arvados.config``
 ^^^^^^^^^^^^^^^^^^^
 
-This state will configure the arvados service and has a dependency on ``arvados.install``
-via include list.
+This state will configure the arvados cluster. As all the arvados components use the same config
+file, any of the following components will include this state and you will rarely need to call it
+independently. You can still do, as to get a parsed config file to use somewhere else.
 
 
-``arvados.service``
-^^^^^^^^^^^^^^^^^^^^
+``arvados.repo``
+^^^^^^^^^^^^^^^^
 
 
-This state will start the arvados service and has a dependency on ``arvados.config``
-via include list.
+This state will configure the arvados repository.
 
 
-``arvados.clean``
-^^^^^^^^^^^^^^^^^^
+``arvados.repo.clean``
+^^^^^^^^^^^^^^^^^^^^^^^
+
+This state will remove the arvados repository configuration.
+
+``arvados.shell``
+^^^^^^^^^^^^^^^^^
 
 *Meta-state (This is a state that includes other states)*.
 
 
 *Meta-state (This is a state that includes other states)*.
 
-this state will undo everything performed in the ``arvados`` meta-state in reverse order, i.e.
-stops the service,
-removes the configuration file and
-then uninstalls the package.
+This state installs an `arvados shell node <https://doc.arvados.org/master/install/install-shell-server.html>`_.
+
+``arvados.shell.clean``
+^^^^^^^^^^^^^^^^^^^^^^^
+
+*Meta-state (This is a state that includes other states)*.
+
+this state will undo everything performed in the ``arvados.shell`` meta-state in reverse order, i.e.
+uninstalls the packages and gems.
+
+``arvados.shell.package``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This state will install the arvados shell packages and gems only.
+
+``arvados.shell.package.clean``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This state will remove the packages and gems of the arvados shell node.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+``arvados.service``
+^^^^^^^^^^^^^^^^^^^^
+
+This state will start the arvados service and has a dependency on ``arvados.config``
+via include list.
 
 ``arvados.service.clean``
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 ``arvados.service.clean``
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,28 +164,6 @@ dependency on ``arvados.service.clean`` via include list.
 This state will remove the arvados package and has a depency on
 ``arvados.config.clean`` via include list.
 
 This state will remove the arvados package and has a depency on
 ``arvados.config.clean`` via include list.
 
-``arvados.subcomponent``
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-*Meta-state (This is a state that includes other states)*.
-
-This state installs a subcomponent configuration file before
-configuring and starting the arvados service.
-
-``arvados.subcomponent.config``
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This state will configure the arvados subcomponent and has a
-dependency on ``arvados.config`` via include list.
-
-``arvados.subcomponent.config.clean``
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This state will remove the configuration of the arvados subcomponent
-and reload the arvados service by a dependency on
-``arvados.service.running`` via include list and ``watch_in``
-requisite.
-
 Testing
 -------
 
 Testing
 -------
 
@@ -146,7 +182,7 @@ Requirements
    $ bin/kitchen test [platform]
 
 Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
    $ bin/kitchen test [platform]
 
 Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
-e.g. ``debian-9-2019-2-py3``.
+e.g. ``debian-10-3000-1-py3``.
 
 ``bin/kitchen converge``
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
 ``bin/kitchen converge``
 ^^^^^^^^^^^^^^^^^^^^^^^^
index cca69c42a3d179cce33f7160ea70d0da0613570a..ff0d8c0ac900caa03f40b4d1078806d86332479b 100644 (file)
@@ -11,148 +11,19 @@ driver:
 # Make sure the platforms listed below match up with
 # the `env.matrix` instances defined in `.travis.yml`
 platforms:
 # Make sure the platforms listed below match up with
 # the `env.matrix` instances defined in `.travis.yml`
 platforms:
-  ## SALT `master`
-  - name: debian-10-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:debian-10
-  - name: ubuntu-1804-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:ubuntu-18.04
-  - name: centos-8-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:centos-8
-  - name: fedora-31-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:fedora-31
-  - name: opensuse-leap-151-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:opensuse-leap-15.1
-      run_command: /usr/lib/systemd/systemd
-    # Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
-    # => SCP did not finish successfully (255):  (Net::SCP::Error)
-    transport:
-      max_ssh_sessions: 1
-  - name: amazonlinux-2-master-py3
-    driver:
-      image: netmanagers/salt-master-py3:amazonlinux-2
-  - name: arch-base-latest-master-py2
-    driver:
-      image: netmanagers/salt-master-py2:arch-base-latest
-      run_command: /usr/lib/systemd/systemd
-
   ## SALT `3000.1`
   - name: debian-10-3000-1-py3
     driver:
       image: netmanagers/salt-3000.1-py3:debian-10
   ## SALT `3000.1`
   - name: debian-10-3000-1-py3
     driver:
       image: netmanagers/salt-3000.1-py3:debian-10
-  - name: ubuntu-1804-3000-1-py3
-    driver:
-      image: netmanagers/salt-3000.1-py3:ubuntu-18.04
-  - name: centos-8-3000-1-py3
-    driver:
-      image: netmanagers/salt-3000.1-py3:centos-8
-  - name: fedora-31-3000-1-py3
-    driver:
-      image: netmanagers/salt-3000.1-py3:fedora-31
-  - name: opensuse-leap-151-3000-1-py3
-    driver:
-      image: netmanagers/salt-3000.1-py3:opensuse-leap-15.1
-      run_command: /usr/lib/systemd/systemd
-    # Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
-    # => SCP did not finish successfully (255):  (Net::SCP::Error)
-    transport:
-      max_ssh_sessions: 1
-  - name: amazonlinux-2-3000-1-py3
-    driver:
-      image: netmanagers/salt-3000.1-py3:amazonlinux-2
-  - name: arch-base-latest-3000-1-py2
-    driver:
-      image: netmanagers/salt-3000.1-py2:arch-base-latest
-      run_command: /usr/lib/systemd/systemd
 
 
-  ## SALT `2019.2`
-  - name: debian-10-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:debian-10
-  - name: debian-9-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:debian-9
-  - name: ubuntu-1804-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:ubuntu-18.04
-  - name: ubuntu-1604-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:ubuntu-16.04
-  - name: centos-8-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:centos-8
-  - name: centos-7-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:centos-7
-  - name: fedora-31-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:fedora-31
-  - name: opensuse-leap-151-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:opensuse-leap-15.1
-      run_command: /usr/lib/systemd/systemd
-    # Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
-    # => SCP did not finish successfully (255):  (Net::SCP::Error)
-    transport:
-      max_ssh_sessions: 1
-  - name: amazonlinux-2-2019-2-py3
-    driver:
-      image: netmanagers/salt-2019.2-py3:amazonlinux-2
-  - name: ubuntu-1804-2019-2-py2
-    driver:
-      image: netmanagers/salt-2019.2-py2:ubuntu-18.04
-  - name: amazonlinux-1-2019-2-py2
-    driver:
-      image: netmanagers/salt-2019.2-py2:amazonlinux-1
-      run_command: /sbin/init
-  - name: arch-base-latest-2019-2-py2
-    driver:
-      image: netmanagers/salt-2019.2-py2:arch-base-latest
-      run_command: /usr/lib/systemd/systemd
+#   - name: ubuntu-1804-3000-1-py3
+#     driver:
+#       image: netmanagers/salt-3000.1-py3:ubuntu-18.04
 
 
-  ## SALT `2018.3`
-  - name: centos-7-2018-3-py3
-    driver:
-      image: netmanagers/salt-2018.3-py3:centos-7
-  - name: fedora-30-2018-3-py3
-    driver:
-      image: netmanagers/salt-2018.3-py3:fedora-30
-  - name: debian-9-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:debian-9
-  - name: debian-8-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:debian-8
-  - name: ubuntu-1804-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:ubuntu-18.04
-  - name: ubuntu-1604-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:ubuntu-16.04
-  - name: centos-6-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:centos-6
-      run_command: /sbin/init
-  - name: opensuse-leap-151-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1
-      run_command: /usr/lib/systemd/systemd
-    # Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
-    # => SCP did not finish successfully (255):  (Net::SCP::Error)
-    transport:
-      max_ssh_sessions: 1
-  - name: amazonlinux-1-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:amazonlinux-1
-      run_command: /sbin/init
-  - name: arch-base-latest-2018-3-py2
-    driver:
-      image: netmanagers/salt-2018.3-py2:arch-base-latest
-      run_command: /usr/lib/systemd/systemd
+#   ## SALT `2019.2`
+#   - name: centos-7-2019-2-py3
+#     driver:
+#       image: netmanagers/salt-2019.2-py3:centos-7
 
 provisioner:
   name: salt_solo
 
 provisioner:
   name: salt_solo
@@ -173,43 +44,143 @@ verifier:
     - cli
 
 suites:
     - cli
 
 suites:
-  - name: default
-    excludes:
-      - centos-6-2018-3-py2
+  #### api,websocket,keepproxy,keepweb,controller
+  - name: api
+    driver:
+      hostname: example.net
     provisioner:
       state_top:
         base:
           '*':
     provisioner:
       state_top:
         base:
           '*':
-            - arvados
+            - example_add_snakeoil_certs
+            - nginx.passenger
+            - postgres
+            - arvados.repo
+            - arvados.api
+            - arvados.websocket
+            # keepproxy complains when using snakeoil certs, so we can't
+            # properly test it here until next version removes this limitation
+            # - arvados.keepproxy
+            - arvados.keepweb
+            - arvados.controller
       pillars:
         top.sls:
           base:
             '*':
               - arvados
       pillars:
         top.sls:
           base:
             '*':
               - arvados
-              - define_roles
+              - example_postgres
+              - example_nginx
+              - example_nginx_api
+              - example_nginx_websocket
+              - example_nginx_keepweb
+              - example_nginx_controller
+              # keepproxy expects to retrieve a list of services from API, so
+              # installing/testing it without an api server running will fail
+              # - example_nginx_keepproxy
       pillars_from_files:
         arvados.sls: pillar.example
       pillars_from_files:
         arvados.sls: pillar.example
-        define_roles.sls: test/salt/pillar/define_roles.sls
+        example_postgres.sls: test/salt/pillar/examples/postgresql.sls
+        example_nginx.sls: test/salt/pillar/examples/nginx_passenger.sls
+        example_nginx_api.sls: test/salt/pillar/examples/nginx_api_configuration.sls
+        example_nginx_websocket.sls: test/salt/pillar/examples/nginx_websocket_configuration.sls
+        example_nginx_keepweb.sls: test/salt/pillar/examples/nginx_keepweb_configuration.sls
+        # example_nginx_keepproxy.sls: test/salt/pillar/examples/nginx_keepproxy_configuration.sls
+        example_nginx_controller.sls: test/salt/pillar/examples/nginx_controller_configuration.sls
+      dependencies:
+        - name: example_add_snakeoil_certs
+          path: test/salt/states
+        - name: postgres
+          repo: git
+          source: https://github.com/saltstack-formulas/postgres-formula.git
+        - name: nginx
+          repo: git
+          source: https://github.com/saltstack-formulas/nginx-formula.git
     verifier:
       inspec_tests:
     verifier:
       inspec_tests:
-        - path: test/integration/default
-  - name: centos6
-    includes:
-      - centos-6-2018-3-py2
+        - path: test/integration/api
+        - path: test/integration/websocket
+        # - path: test/integration/keepproxy
+        - path: test/integration/keepweb
+        - path: test/integration/controller
+
+  #### workbench,workbench2
+  - name: workbench
+    driver:
+      hostname: workbench.example.net
     provisioner:
       state_top:
         base:
           '*':
     provisioner:
       state_top:
         base:
           '*':
-            - arvados
+            - example_add_snakeoil_certs
+            - nginx.passenger
+            - arvados.repo
+            - arvados.workbench
+            - arvados.workbench2
       pillars:
         top.sls:
           base:
             '*':
               - arvados
       pillars:
         top.sls:
           base:
             '*':
               - arvados
-              - define_roles
+              - example_nginx
+              - example_nginx_workbench
+              - example_nginx_workbench2
       pillars_from_files:
       pillars_from_files:
-        arvados.sls: test/salt/pillar/centos6.sls
-        define_roles.sls: test/salt/pillar/define_roles.sls
+        arvados.sls: pillar.example
+        example_nginx.sls: test/salt/pillar/examples/nginx_passenger.sls
+        example_nginx_workbench.sls: test/salt/pillar/examples/nginx_workbench_configuration.sls
+        example_nginx_workbench2.sls: test/salt/pillar/examples/nginx_workbench2_configuration.sls
+      dependencies:
+        - name: example_add_snakeoil_certs
+          path: test/salt/states
+        - name: nginx
+          repo: git
+          source: https://github.com/saltstack-formulas/nginx-formula.git
+    verifier:
+      inspec_tests:
+        - path: test/integration/workbench
+        - path: test/integration/workbench2
+
+  #### shell
+  - name: shell
+    driver:
+      hostname: shell.example.net
+    provisioner:
+      state_top:
+        base:
+          '*':
+            # We also test repo here. No sense for a whole separate suite
+            - arvados.repo
+            - arvados.shell
+      pillars:
+        top.sls:
+          base:
+            '*':
+              - arvados
+      pillars_from_files:
+        arvados.sls: pillar.example
+    verifier:
+      inspec_tests:
+        - path: test/integration/repo
+        - path: test/integration/shell
+
+  #### keepstore
+  - name: keepstore
+    driver:
+      hostname: keep0.example.net
+    provisioner:
+      state_top:
+        base:
+          '*':
+            - arvados.repo
+            - arvados.keepstore.service
+            # - arvados.clean
+      pillars:
+        top.sls:
+          base:
+            '*':
+              - arvados
+      pillars_from_files:
+        arvados.sls: pillar.example
     verifier:
       inspec_tests:
     verifier:
       inspec_tests:
-        - path: test/integration/default
+        - path: test/integration/keepstore
index 96f3b5f8a5a1184fcdfca0623351ae449ea2e9fe..c3f669d05e7152b089d260a23fd44eb06cc193fc 100644 (file)
 # -*- coding: utf-8 -*-
 # vim: ft=yaml
 ---
 # -*- coding: utf-8 -*-
 # vim: ft=yaml
 ---
+# The variables commented out are the default values that the formula uses.
+# The uncommented values are REQUIRED values. If you don't set them, running
+# this formula will fail.
 arvados:
 arvados:
-  lookup:
-    master: template-master
-    # Just for testing purposes
-    winner: lookup
-    added_in_lookup: lookup_value
-
-  # Using bash package and udev service as an example. This allows us to
-  # test the template formula itself. You should set these parameters to
-  # examples that make sense in the contexto of the formula you're writing.
-  pkg:
-    name: bash
-  service:
-    name: systemd-journald
-  config: /etc/template-formula.conf
-
-  tofs:
-    # The files_switch key serves as a selector for alternative
-    # directories under the formula files directory. See TOFS pattern
-    # doc for more info.
-    # Note: Any value not evaluated by `config.get` will be used literally.
-    # This can be used to set custom paths, as many levels deep as required.
-    files_switch:
-      - any/path/can/be/used/here
-      - id
-      - roles
-      - osfinger
-      - os
-      - os_family
-    # All aspects of path/file resolution are customisable using the options below.
-    # This is unnecessary in most cases; there are sensible defaults.
-    # Default path: salt://< path_prefix >/< dirs.files >/< dirs.default >
-    #         I.e.: salt://arvados/files/default
-    # path_prefix: template_alt
-    # dirs:
-    #   files: files_alt
-    #   default: default_alt
-    # The entries under `source_files` are prepended to the default source files
-    # given for the state
-    # source_files:
-    #   arvados-config-file-file-managed:
-    #     - 'example_alt.tmpl'
-    #     - 'example_alt.tmpl.jinja'
-
-    # For testing purposes
-    source_files:
-      arvados-config-file-file-managed:
-        - 'example.tmpl.jinja'
-      arvados-subcomponent-config-file-file-managed:
-        - 'subcomponent-example.tmpl.jinja'
-
-  # Just for testing purposes
-  winner: pillar
-  added_in_pillar: pillar_value
+  ### GENERAL CONFIG
+  # version: '2.0.2'
+  ## It makes little sense to disable this flag, but you can, if you want :)
+  # use_upstream_repo: true
+
+  ## Repo URL is built with grains values. If desired, it can be completely
+  ## overwritten with the pillar parameter 'repo_url'
+  # repo:
+  #   humanname: Arvados Official Repository
+
+  ## IMPORTANT!!!!!
+  ## api, workbench and shell require some gems, so you need to make sure ruby
+  ## and deps are installed in order to install and compile the gems.
+  ## We default to `false` in these two variables as it's expected you already
+  ## manage OS packages with some other tool and you don't want us messing up
+  ## with your setup.
+  ruby:
+    ## We set these to `true` here for testing purposes.
+    ## They both default to `false`.
+    manage_ruby: true
+    manage_gems_deps: true
+    # pkg: ruby
+    # gems_deps:
+    #     - curl
+    #     - g++
+    #     - gcc
+    #     - git
+    #     - libcurl4
+    #     - libcurl4-gnutls-dev
+    #     - libpq-dev
+    #     - libxml2
+    #     - libxml2-dev
+    #     - make
+    #     - python-dev
+    #     - ruby-dev
+    #     - zlib1g-dev
+
+  # config:
+  #   file: /etc/arvados/config.yml
+  #   user: root
+  ## IMPORTANT!!!!!
+  ## If you're intalling any of the rails apps (api, workbench), the group
+  ## should be set to that of the web server, usually `www-data`
+  #   group: root
+  #   mode: 640
+
+  ### ARVADOS CLUSTER CONFIG
+  cluster:
+    name: fixme
+    domain: example.net
+
+    database:
+      # max concurrent connections per arvados server daemon
+      # connection_pool_max: 32
+      name: arvados
+      host: 127.0.0.1
+      password: changeme_arvados
+      user: arvados
+      encoding: en_US.utf8
+      client_encoding: UTF8
+
+    tls:
+      # certificate: ''
+      # key: ''
+      # required to test with snakeoil certs
+      insecure: true
+
+    ### TOKENS
+    tokens:
+      system_root: changeme_system_root_token
+      management: changeme_management_token
+      rails_secret: changeme_rails_secret_token
+      anonymous_user: changeme_anonymous_user_token
+      provider_secret: changeme_provider_secret_token
+
+    ### KEYS
+    secrets:
+      blob_signing_key: changeme_blob_signing_key
+      workbench_secret_key: changeme_workbench_secret_key
+      dispatcher_access_key: changeme_dispatcher_access_key
+      dispatcher_secret_key: changeme_dispatcher_secret_key
+      keep_access_key: changeme_keep_access_key
+      keep_secret_key: changeme_keep_secret_key
+
+    ### VOLUMES
+    ## This should usually match all your `keepstore` instances
+    volumes:
+      volume_one:
+        # the volume name will be composed with
+        # <cluster>-nyw5e-<volume>
+        cluster: fixme
+        volume_id: '000000000000000'
+        access_via_hosts:
+          "http://keep0.example.net:25107/": {}
+        replication: 2
+        driver: Directory
+        driver_parameters:
+          Root: /tmp
+
+#  ## SERVICES
+#  #### API
+#   api:
+#     pkg:
+#       name:
+#         - arvados-api-server
+#         - arvados-dispatch-cloud
+#     gem:
+#       name:
+#         - arvados-cli
+#     service:
+#       name:
+#         - nginx
+#       port: 8004
+#  #### CONTROLLER
+#   controller:
+#     pkg:
+#       name: arvados-controller
+#     service:
+#       name: arvados-controller
+#       port: 8003
+#  #### DISPATCHER
+#   dispatcher:
+#     pkg:
+#       name:
+#         - crunch-dispatch-local
+#       #   - arvados-dispatch-cloud
+#       #   - crunch-dispatch-slurm
+#     service:
+#       name: crunch-dispatch-local
+#       port: 9006
+#  #### KEEPPROXY
+#   keepproxy:
+#     pkg:
+#       name: keepproxy
+#     service:
+#       name: keepproxy
+#       port: 25107
+#  #### KEEPWEB
+#   keepweb:
+#     pkg:
+#       name: keep-web
+#     service:
+#       name: keep-web
+#     #   webdav
+#       port: 9002
+#  #### KEEPSTORE
+#   keepstore:
+#     pkg:
+#       name: keepstore
+#     service:
+#       name: keepstore
+#       port: 25107
+#  #### GIT-HTTPD
+#   githttpd:
+#     pkg:
+#       name: arvados-git-httpd
+#     service:
+#       name: arvados-git-httpd
+#       port: 9001
+#  #### SHELL
+#   shell:
+#     pkg:
+#       name:
+#         - arvados-client
+#         - arvados-src
+#         - libpam-arvados
+#         - python-arvados-fuse
+#         - python-arvados-python-client
+#         - python3-arvados-cwl-runner
+#     gem:
+#       name:
+#         - arvados-cli
+#         - arvados-login-sync
+#  #### WORKBENCH
+#   workbench:
+#     pkg:
+#       name: arvados-workbench
+#     service:
+#       name: nginx
+#  #### WORKBENCH2
+#   workbench2:
+#     pkg:
+#       name: arvados-workbench2
+#     service:
+#       name: nginx
+#  ####  WEBSOCKET
+#   websocket:
+#     pkg:
+#       name: arvados-ws
+#     service:
+#       name: arvados-ws
+#       port: 8005
+#  #### SSO
+#   sso:
+#     pkg:
+#       name: arvados-sso
+#     service:
+#       name: arvados-sso
+#       port: 8900
+
+#  ## SALTSTACK FORMULAS TOFS configuration
+#   https://template-formula.readthedocs.io/en/latest/TOFS_pattern.html
+#   tofs:
+#   #    The files_switch key serves as a selector for alternative
+#   #    directories under the formula files directory. See TOFS pattern
+#   #    doc for more info.
+#   #    Note: Any value not evaluated by `config.get` will be used literally.
+#   #    This can be used to set custom paths, as many levels deep as required.
+#     files_switch:
+#       - any/path/can/be/used/here
+#       - id
+#       - roles
+#       - osfinger
+#       - os
+#       - os_family
+#   #    All aspects of path/file resolution are customisable using the options below.
+#   #    This is unnecessary in most cases; there are sensible defaults.
+#   #    Default path: salt://< path_prefix >/< dirs.files >/< dirs.default >
+#   #            I.e.: salt://arvados/files/default
+#   #    path_prefix: template_alt
+#   #    dirs:
+#   #      files: files_alt
+#   #      default: default_alt
+#   #    The entries under `source_files` are prepended to the default source files
+#   #    given for the state
+#   #    source_files:
+#   #      arvados-config-file-file-managed:
+#   #        - 'example_alt.tmpl'
+#   #        - 'example_alt.tmpl.jinja'
diff --git a/test/integration/api/controls/config_spec.rb b/test/integration/api/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..8efe253
--- /dev/null
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+api_stanza = <<-API_STANZA
+    API:
+      RailsSessionSecretToken: "changeme_rails_secret_token"
+API_STANZA
+
+rails_stanza = <<-RAILS_STANZA
+      RailsAPI:
+        InternalURLs:
+          "http://localhost:8004": {}
+RAILS_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired api lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(api_stanza) }
+    its('content') { should include(rails_stanza) }
+  end
+end
diff --git a/test/integration/api/controls/packages_spec.rb b/test/integration/api/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..25641d3
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados api package' do
+  title 'should be installed'
+
+  describe package('arvados-api-server') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/api/controls/services_spec.rb b/test/integration/api/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..26d004c
--- /dev/null
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+control 'arvados api service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('nginx') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+
+  describe port(8004) do
+    it { should be_listening }
+    its('processes') { should include 'nginx' }
+  end
+end
diff --git a/test/integration/api/inspec.yml b/test/integration/api/inspec.yml
new file mode 100644 (file)
index 0000000..36440eb
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: api
+title: arvados formula api submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula api is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/controller/controls/config_spec.rb b/test/integration/controller/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..6e64bc4
--- /dev/null
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+controller_stanza = <<-CONTROLLER_STANZA
+      Keepstore:
+        InternalURLs:
+          "http://keep0.example.net:25107/": {}
+CONTROLLER_STANZA
+
+volumes_stanza = <<-VOLUMES_STANZA
+    Volumes:
+      ### VOLUME_ONE
+      fixme-nyw5e-000000000000000:
+        Driver: Directory
+        DriverParameters: {Root: /tmp}
+        AccessViaHosts: {'http://keep0.example.net:25107/': {}}
+        Replication: 2
+VOLUMES_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired controller lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    # We're testing it in the API instance, so group will be nginx's
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(controller_stanza) }
+    its('content') { should include(volumes_stanza) }
+  end
+end
diff --git a/test/integration/controller/controls/packages_spec.rb b/test/integration/controller/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..29715b1
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados controller package' do
+  title 'should be installed'
+
+  describe package('keep-web') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/controller/controls/services_spec.rb b/test/integration/controller/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..abee521
--- /dev/null
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+control 'arvados controller service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('keep-web') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+  describe port(9002) do
+    it { should be_listening }
+    its('processes') { should include 'keep-web' }
+  end
+end
diff --git a/test/integration/controller/inspec.yml b/test/integration/controller/inspec.yml
new file mode 100644 (file)
index 0000000..d5f4657
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: controller
+title: arvados formula controller submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula controller is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/default/README.md b/test/integration/default/README.md
deleted file mode 100644 (file)
index 37cf963..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# InSpec Profile: `default`
-
-This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
-
-## Verify a profile
-
-InSpec ships with built-in features to verify a profile structure.
-
-```bash
-$ inspec check default
-Summary
--------
-Location: default
-Profile: profile
-Controls: 4
-Timestamp: 2019-06-24T23:09:01+00:00
-Valid: true
-
-Errors
-------
-
-Warnings
---------
-```
-
-## Execute a profile
-
-To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
-
-```bash
-$ inspec exec default
-..
-
-Finished in 0.0025 seconds (files took 0.12449 seconds to load)
-8 examples, 0 failures
-```
-
-## Execute a specific control from a profile
-
-To run one control from the profile use `inspec exec /path/to/profile --controls name`.
-
-```bash
-$ inspec exec default --controls package
-.
-
-Finished in 0.0025 seconds (files took 0.12449 seconds to load)
-1 examples, 0 failures
-```
-
-See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/default/controls/config_spec.rb
deleted file mode 100644 (file)
index 7d0a8ce..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-control 'arvados configuration' do
-  title 'should match desired lines'
-
-  describe file('/etc/template-formula.conf') do
-    it { should be_file }
-    it { should be_owned_by 'root' }
-    it { should be_grouped_into 'root' }
-    its('mode') { should cmp '0644' }
-    its('content') do
-      should include(
-        'This is another example file from SaltStack template-formula.'
-      )
-    end
-    its('content') { should include '"added_in_pillar": "pillar_value"' }
-    its('content') { should include '"added_in_defaults": "defaults_value"' }
-    its('content') { should include '"added_in_lookup": "lookup_value"' }
-    its('content') { should include '"config": "/etc/template-formula.conf"' }
-    its('content') { should include '"lookup": {"added_in_lookup": "lookup_value",' }
-    its('content') { should include '"pkg": {"name": "' }
-    its('content') { should include '"service": {"name": "' }
-    its('content') do
-      should include(
-        '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\
-        '"roles", "osfinger", "os", "os_family"], "source_files": '\
-        '{"arvados-config-file-file-managed": ["example.tmpl.jinja"], '\
-        '"arvados-subcomponent-config-file-file-managed": '\
-        '["subcomponent-example.tmpl.jinja"]}'
-      )
-    end
-    its('content') { should include '"arch": "amd64"' }
-    its('content') { should include '"winner": "pillar"}' }
-    its('content') { should include 'winner of the merge: pillar' }
-  end
-end
diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb
deleted file mode 100644 (file)
index aacd274..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-# Overide by OS
-package_name = 'bash'
-package_name = 'cronie' if (os[:name] == 'centos') && os[:release].start_with?('6')
-
-control 'arvados package' do
-  title 'should be installed'
-
-  describe package(package_name) do
-    it { should be_installed }
-  end
-end
diff --git a/test/integration/default/controls/services_spec.rb b/test/integration/default/controls/services_spec.rb
deleted file mode 100644 (file)
index 58347b6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-# Overide by OS
-service_name = 'systemd-journald'
-service_name = 'crond' if (os[:name] == 'centos') && os[:release].start_with?('6')
-
-control 'arvados service' do
-  impact 0.5
-  title 'should be running and enabled'
-
-  describe service(service_name) do
-    it { should be_enabled }
-    it { should be_running }
-  end
-end
diff --git a/test/integration/default/controls/subcomponent_config_spec.rb b/test/integration/default/controls/subcomponent_config_spec.rb
deleted file mode 100644 (file)
index edaab02..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-control 'arvados subcomponent configuration' do
-  title 'should match desired lines'
-
-  describe file('/etc/arvados-subcomponent-formula.conf') do
-    it { should be_file }
-    it { should be_owned_by 'root' }
-    it { should be_grouped_into 'root' }
-    its('mode') { should cmp '0644' }
-    its('content') do
-      should include(
-        '# File managed by Salt at '\
-        '<salt://arvados/subcomponent/config/files/default/'\
-        'subcomponent-example.tmpl.jinja>.'
-      )
-    end
-    its('content') do
-      should include(
-        'This is another subcomponent example file from SaltStack '\
-        'template-formula.'
-      )
-    end
-  end
-end
diff --git a/test/integration/default/inspec.yml b/test/integration/default/inspec.yml
deleted file mode 100644 (file)
index 5fe9a8f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
----
-name: default
-title: arvados formula
-maintainer: SaltStack Formulas
-license: Apache-2.0
-summary: Verify that the arvados formula is setup and configured correctly
-supports:
-  - platform-name: debian
-  - platform-name: ubuntu
-  - platform-name: centos
-  - platform-name: fedora
-  - platform-name: opensuse
-  - platform-name: suse
-  - platform-name: freebsd
-  - platform-name: amazon
-  - platform-name: arch
diff --git a/test/integration/keepproxy/controls/config_spec.rb b/test/integration/keepproxy/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..30feed4
--- /dev/null
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+keepproxy_stanza = <<-KEEPPROXY_STANZA
+      Keepstore:
+        InternalURLs:
+          "http://keep0.example.net:25107/": {}
+KEEPPROXY_STANZA
+
+volumes_stanza = <<-VOLUMES_STANZA
+    Volumes:
+      ### VOLUME_ONE
+      fixme-nyw5e-000000000000000:
+        Driver: Directory
+        DriverParameters: {Root: /tmp}
+        AccessViaHosts: {'http://keep0.example.net:25107/': {}}
+        Replication: 2
+VOLUMES_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired keepproxy lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    # We're testing it in the API instance, so group will be nginx's
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(keepproxy_stanza) }
+    its('content') { should include(volumes_stanza) }
+  end
+end
diff --git a/test/integration/keepproxy/controls/packages_spec.rb b/test/integration/keepproxy/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..28a48f6
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados keepproxy package' do
+  title 'should be installed'
+
+  describe package('keepproxy') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/keepproxy/controls/services_spec.rb b/test/integration/keepproxy/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..4106acc
--- /dev/null
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+control 'arvados keepproxy service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('keepproxy') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+  describe port(25_107) do
+    it { should be_listening }
+    its('processes') { should include 'keepproxy' }
+  end
+end
diff --git a/test/integration/keepproxy/inspec.yml b/test/integration/keepproxy/inspec.yml
new file mode 100644 (file)
index 0000000..6da10fd
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: keepproxy
+title: arvados formula keepproxy submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula keepproxy is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/keepstore/controls/config_spec.rb b/test/integration/keepstore/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..9fb74c9
--- /dev/null
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+keepstore_stanza = <<-KEEPSTORE_STANZA
+      Keepstore:
+        InternalURLs:
+          "http://keep0.example.net:25107/": {}
+KEEPSTORE_STANZA
+
+volumes_stanza = <<-VOLUMES_STANZA
+    Volumes:
+      ### VOLUME_ONE
+      fixme-nyw5e-000000000000000:
+        Driver: Directory
+        DriverParameters: {Root: /tmp}
+        AccessViaHosts: {'http://keep0.example.net:25107/': {}}
+        Replication: 2
+VOLUMES_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired keepstore lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    it { should be_grouped_into 'root' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(keepstore_stanza) }
+    its('content') { should include(volumes_stanza) }
+  end
+end
diff --git a/test/integration/keepstore/controls/packages_spec.rb b/test/integration/keepstore/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..fa40464
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados keepstore package' do
+  title 'should be installed'
+
+  describe package('keepstore') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/keepstore/controls/services_spec.rb b/test/integration/keepstore/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..df376a5
--- /dev/null
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+control 'arvados keepstore service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('keepstore') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+  describe port(25_107) do
+    it { should be_listening }
+    its('processes') { should include 'keepstore' }
+  end
+end
diff --git a/test/integration/keepstore/inspec.yml b/test/integration/keepstore/inspec.yml
new file mode 100644 (file)
index 0000000..0da62ce
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: keepstore
+title: arvados formula keepstore submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula keepstore is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/keepweb/controls/config_spec.rb b/test/integration/keepweb/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..c678dcc
--- /dev/null
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+keepweb_stanza = <<-KEEPWEB_STANZA
+      WebDAV:
+        ExternalURL: https://collections.example.net
+        InternalURLs:
+          "http://localhost:9002": {}
+      WebDAVDownload:
+        ExternalURL: https://download.example.net
+KEEPWEB_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired keepweb lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    # We're testing it in the API instance, so group will be nginx's
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(keepweb_stanza) }
+  end
+end
diff --git a/test/integration/keepweb/controls/packages_spec.rb b/test/integration/keepweb/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..a512909
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados keepweb package' do
+  title 'should be installed'
+
+  describe package('keep-web') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/keepweb/controls/services_spec.rb b/test/integration/keepweb/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..268af29
--- /dev/null
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+control 'arvados keepweb service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('keep-web') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+  describe port(9002) do
+    it { should be_listening }
+    its('processes') { should include 'keep-web' }
+  end
+end
diff --git a/test/integration/keepweb/inspec.yml b/test/integration/keepweb/inspec.yml
new file mode 100644 (file)
index 0000000..6633046
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: keepweb
+title: arvados formula keepweb submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula keepweb is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/repo/controls/repo_spec.rb b/test/integration/repo/controls/repo_spec.rb
new file mode 100644 (file)
index 0000000..27cf73f
--- /dev/null
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+case os[:name]
+when 'centos'
+  repo_file = '/etc/yum.repos.d/arvados.repo'
+  repo_url = 'baseurl=http://rpm.arvados.org/CentOS/$releasever/os/$basearch/'
+when 'debian'
+  repo_file = '/etc/apt/sources.list.d/arvados.list'
+  repo_url = 'deb http://apt.arvados.org buster main'
+end
+
+control 'arvados repository' do
+  impact 1
+  title 'should be configured'
+  desc 'Ensures arvados source is correctly configured'
+  describe file(repo_file) do
+    its('content') { should match repo_url }
+  end
+end
diff --git a/test/integration/repo/inspec.yml b/test/integration/repo/inspec.yml
new file mode 100644 (file)
index 0000000..b9977f0
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: repo
+title: arvados formula repo submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados repository is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/shell/controls/packages_spec.rb b/test/integration/shell/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..080095d
--- /dev/null
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+packages_list = %w[
+  arvados-client
+  arvados-src
+  libpam-arvados
+  python-arvados-fuse
+  python-arvados-python-client
+  python3-arvados-cwl-runner
+]
+
+gems_list = %w[
+  arvados-cli
+  arvados-login-sync
+]
+
+control 'arvados shell packages' do
+  title 'should be installed'
+
+  packages_list.each do |p|
+    describe package(p) do
+      it { should be_installed }
+    end
+  end
+end
+
+control 'arvados shell gems' do
+  title 'should be installed'
+
+  gems_list.each do |p|
+    describe gem(p) do
+      it { should be_installed }
+    end
+  end
+end
diff --git a/test/integration/shell/inspec.yml b/test/integration/shell/inspec.yml
new file mode 100644 (file)
index 0000000..db109af
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: shell
+title: arvados formula shell submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula shell submodule is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/websocket/controls/config_spec.rb b/test/integration/websocket/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..57c237b
--- /dev/null
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+websocket_stanza = <<-WEBSOCKET_STANZA
+      Websocket:
+        ExternalURL: wss://ws.example.net/websocket
+        InternalURLs:
+          "http://localhost:8005": {}
+WEBSOCKET_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired websocket lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    # We're testing it in the API instance, so group will be nginx's
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(websocket_stanza) }
+  end
+end
diff --git a/test/integration/websocket/controls/packages_spec.rb b/test/integration/websocket/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..bd7936b
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados websocket package' do
+  title 'should be installed'
+
+  describe package('arvados-ws') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/websocket/controls/services_spec.rb b/test/integration/websocket/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..ffdd109
--- /dev/null
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+control 'arvados websocket service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('arvados-ws') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+
+  describe port(8005) do
+    it { should be_listening }
+    its('processes') { should include 'arvados-ws' }
+  end
+end
diff --git a/test/integration/websocket/inspec.yml b/test/integration/websocket/inspec.yml
new file mode 100644 (file)
index 0000000..8a7d955
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: websocket
+title: arvados formula websocket submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula websocket is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/workbench/controls/config_spec.rb b/test/integration/workbench/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..7a2de62
--- /dev/null
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+workbench_config = <<-WORKBENCH_STANZA
+    Workbench:
+      SecretKeyBase: changeme_workbench_secret_key
+      SiteName:  FIXME
+WORKBENCH_STANZA
+
+workbench_service = <<-WORKBENCH_SERVICE_STANZA
+      Workbench1:
+        ExternalURL: "https://workbench.example.net"
+WORKBENCH_SERVICE_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired workbench lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(workbench_config) }
+    its('content') { should include(workbench_service) }
+  end
+end
diff --git a/test/integration/workbench/controls/packages_spec.rb b/test/integration/workbench/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..080a619
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados workbench package' do
+  title 'should be installed'
+
+  describe package('arvados-workbench') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/workbench/controls/services_spec.rb b/test/integration/workbench/controls/services_spec.rb
new file mode 100644 (file)
index 0000000..15ae30f
--- /dev/null
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+control 'arvados workbench service' do
+  impact 0.5
+  title 'should be running and enabled'
+
+  describe service('nginx') do
+    it { should be_enabled }
+    it { should be_running }
+  end
+
+  describe port(9000) do
+    it { should be_listening }
+    its('processes') { should include 'nginx' }
+  end
+end
diff --git a/test/integration/workbench/inspec.yml b/test/integration/workbench/inspec.yml
new file mode 100644 (file)
index 0000000..5ffcaf8
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: workbench
+title: arvados formula workbench submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula workbench is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/integration/workbench2/controls/config_spec.rb b/test/integration/workbench2/controls/config_spec.rb
new file mode 100644 (file)
index 0000000..a6da207
--- /dev/null
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+workbench2_service = <<-WORKBENCH2_STANZA
+      Workbench2:
+        ExternalURL: "https://workbench2.example.net"
+WORKBENCH2_STANZA
+
+control 'arvados configuration' do
+  title 'should match desired workbench2 lines'
+
+  describe file('/etc/arvados/config.yml') do
+    it { should be_file }
+    it { should be_owned_by 'root' }
+    it { should be_grouped_into 'www-data' }
+    its('mode') { should cmp '0640' }
+    its('content') do
+      should include(
+        'File managed by Salt at <salt://arvados/files/default/config.tmpl.jinja>.'
+      )
+    end
+    its('content') { should include(workbench2_service) }
+  end
+end
diff --git a/test/integration/workbench2/controls/packages_spec.rb b/test/integration/workbench2/controls/packages_spec.rb
new file mode 100644 (file)
index 0000000..151846c
--- /dev/null
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+control 'arvados workbench2 package' do
+  title 'should be installed'
+
+  describe package('arvados-workbench2') do
+    it { should be_installed }
+  end
+end
diff --git a/test/integration/workbench2/inspec.yml b/test/integration/workbench2/inspec.yml
new file mode 100644 (file)
index 0000000..addfb40
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: workbench2
+title: arvados formula workbench2 submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula workbench2 is setup and configured correctly
+supports:
+  - platform-name: debian
+  - platform-name: ubuntu
+  - platform-name: centos
diff --git a/test/salt/pillar/centos6.sls b/test/salt/pillar/centos6.sls
deleted file mode 100644 (file)
index 4462955..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
----
-arvados:
-  lookup:
-    master: template-master
-    # Just for testing purposes
-    winner: lookup
-    added_in_lookup: lookup_value
-
-  # Using bash package and udev service as an example. This allows us to
-  # test the template formula itself. You should set these parameters to
-  # examples that make sense in the contexto of the formula you're writing.
-  pkg:
-    name: cronie
-  service:
-    name: crond
-  config: /etc/template-formula.conf
-
-  tofs:
-    # The files_switch key serves as a selector for alternative
-    # directories under the formula files directory. See TOFS pattern
-    # doc for more info.
-    # Note: Any value not evaluated by `config.get` will be used literally.
-    # This can be used to set custom paths, as many levels deep as required.
-    files_switch:
-      - any/path/can/be/used/here
-      - id
-      - roles
-      - osfinger
-      - os
-      - os_family
-    # All aspects of path/file resolution are customisable using the options below.
-    # This is unnecessary in most cases; there are sensible defaults.
-    # path_prefix: template_alt
-    # dirs:
-    #   files: files_alt
-    #   default: default_alt
-    # The entries under `source_files` are prepended to the default source files
-    # given for the state
-    # source_files:
-    #   template-config-file-file-managed:
-    #     - 'example_alt.tmpl'
-    #     - 'example_alt.tmpl.jinja'
-
-    # For testing purposes
-    source_files:
-      arvados-config-file-file-managed:
-        - 'example.tmpl.jinja'
-      arvados-subcomponent-config-file-file-managed:
-        - 'subcomponent-example.tmpl.jinja'
-
-  # Just for testing purposes
-  winner: pillar
-  added_in_pillar: pillar_value
diff --git a/test/salt/pillar/define_roles.sls b/test/salt/pillar/define_roles.sls
deleted file mode 100644 (file)
index bfd8b69..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: ft=yaml
----
-# libtofs.jinja must work with tofs.files_switch looked up list
-roles:
-  - foo
-  - bar
diff --git a/test/salt/pillar/examples/nginx_api_configuration.sls b/test/salt/pillar/examples/nginx_api_configuration.sls
new file mode 100644 (file)
index 0000000..c81cd59
--- /dev/null
@@ -0,0 +1,26 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### ARVADOS
+arvados:
+  config:
+    group: www-data
+
+### NGINX
+nginx:
+  ### SITES
+  servers:
+    managed:
+      arvados_api:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - listen: '127.0.0.1:8004'
+            - server_name: api
+            - root: /var/www/arvados-api/current/public
+            - index:  index.html index.htm
+            - access_log: {{ nginx_log }}/api.example.net-upstream.access.log combined
+            - error_log: {{ nginx_log }}/api.example.net-upstream.error.log
+            - passenger_enabled: 'on'
+            - client_max_body_size: 128m
diff --git a/test/salt/pillar/examples/nginx_controller_configuration.sls b/test/salt/pillar/examples/nginx_controller_configuration.sls
new file mode 100644 (file)
index 0000000..15cc63d
--- /dev/null
@@ -0,0 +1,58 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### NGINX
+nginx:
+  ### SERVER
+  server:
+    config:
+
+      ### STREAMS
+      http:
+        'geo $external_client':
+          default: 1
+          '127.0.0.0/24': 0
+        upstream controller_upstream:
+          - server: 'localhost:8003  fail_timeout=10s'
+
+  ### SITES
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_controller_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: example.net api.example.net
+            - listen:
+              - 80 default
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      arvados_controller:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - proxy_pass: 'http://controller_upstream'
+              - proxy_read_timeout: 300
+              - proxy_connect_timeout: 90
+              - proxy_redirect: 'off'
+              - proxy_set_header: X-Forwarded-Proto https
+              - proxy_set_header: 'Host $http_host'
+              - proxy_set_header: 'X-Real-IP $remote_addr'
+              - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
+              - proxy_set_header: 'X-External-Client $external_client'
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/example.net.access.log combined
+            - error_log: {{ nginx_log }}/example.net.error.log
+            - client_max_body_size: 128m
diff --git a/test/salt/pillar/examples/nginx_keepproxy_configuration.sls b/test/salt/pillar/examples/nginx_keepproxy_configuration.sls
new file mode 100644 (file)
index 0000000..3de312a
--- /dev/null
@@ -0,0 +1,56 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### NGINX
+nginx:
+  ### SERVER
+  server:
+    config:
+      ### STREAMS
+      http:
+        upstream keepproxy_upstream:
+          - server: '127.0.0.1:25107 fail_timeout=10s'
+
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_keep_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: keep.example.net
+            - listen:
+              - 80
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      arvados_keepproxy:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: keep.example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - proxy_pass: 'http://keepproxy_upstream'
+              - proxy_read_timeout: 90
+              - proxy_connect_timeout: 90
+              - proxy_redirect: 'off'
+              - proxy_set_header: X-Forwarded-Proto https
+              - proxy_set_header: 'Host $http_host'
+              - proxy_set_header: 'X-Real-IP $remote_addr'
+              - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
+              - proxy_buffering: 'off'
+            - client_body_buffer_size: 64M
+            - client_max_body_size: 64M
+            - proxy_http_version: '1.1'
+            - proxy_request_buffering: 'off'
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/keepproxy.example.net.access.log combined
+            - error_log: {{ nginx_log }}/keepproxy.example.net.error.log
diff --git a/test/salt/pillar/examples/nginx_keepweb_configuration.sls b/test/salt/pillar/examples/nginx_keepweb_configuration.sls
new file mode 100644 (file)
index 0000000..42a7240
--- /dev/null
@@ -0,0 +1,56 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### NGINX
+nginx:
+  ### SERVER
+  server:
+    config:
+      ### STREAMS
+      http:
+        upstream collections_downloads_upstream:
+          - server: '127.0.0.1:9002 fail_timeout=10s'
+
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_collections_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: collections.example.net download.example.net
+            - listen:
+              - 80
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      ### COLLECTIONS / DOWNLOAD
+      arvados_collections_downloads:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: collections.example.net download.example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - proxy_pass: 'http://collections_downloads_upstream'
+              - proxy_read_timeout: 90
+              - proxy_connect_timeout: 90
+              - proxy_redirect: 'off'
+              - proxy_set_header: X-Forwarded-Proto https
+              - proxy_set_header: 'Host $http_host'
+              - proxy_set_header: 'X-Real-IP $remote_addr'
+              - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
+              - proxy_buffering: 'off'
+            - client_max_body_size: 0
+            - proxy_http_version: '1.1'
+            - proxy_request_buffering: 'off'
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/collections.example.net.access.log combined
+            - error_log: {{ nginx_log }}/collections.example.net.error.log
diff --git a/test/salt/pillar/examples/nginx_passenger.sls b/test/salt/pillar/examples/nginx_passenger.sls
new file mode 100644 (file)
index 0000000..1d36e39
--- /dev/null
@@ -0,0 +1,25 @@
+---
+states:
+  - nginx.passenger
+
+{% set nginx_log = '/var/log/nginx' %}
+
+### NGINX
+nginx:
+  install_from_phusionpassenger: true
+  lookup:
+    passenger_package: libnginx-mod-http-passenger
+    passenger_config_file: /etc/nginx/conf.d/mod-http-passenger.conf
+
+  ### SERVER
+  server:
+    config:
+      include: 'modules-enabled/*.conf'
+      worker_processes: 4
+
+  ### SITES
+  servers:
+    managed:
+      # Remove default webserver
+      default:
+        enabled: false
diff --git a/test/salt/pillar/examples/nginx_websocket_configuration.sls b/test/salt/pillar/examples/nginx_websocket_configuration.sls
new file mode 100644 (file)
index 0000000..bc198e1
--- /dev/null
@@ -0,0 +1,56 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### NGINX
+nginx:
+  ### SERVER
+  server:
+    config:
+      ### STREAMS
+      http:
+        upstream websocket_upstream:
+          - server: '127.0.0.1:8005 fail_timeout=10s'
+
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_ws_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: ws.example.net
+            - listen:
+              - 80
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      arvados_websocket:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: ws.example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - proxy_pass: 'http://websocket_upstream'
+              - proxy_read_timeout: 90
+              - proxy_connect_timeout: 90
+              - proxy_redirect: 'off'
+              - proxy_set_header: X-Forwarded-Proto https
+              - proxy_set_header: 'Host $http_host'
+              - proxy_set_header: 'X-Real-IP $remote_addr'
+              - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
+              - proxy_buffering: 'off'
+            - client_body_buffer_size: 64M
+            - client_max_body_size: 64M
+            - proxy_http_version: '1.1'
+            - proxy_request_buffering: 'off'
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/ws.example.net.access.log combined
+            - error_log: {{ nginx_log }}/ws.example.net.error.log
diff --git a/test/salt/pillar/examples/nginx_workbench2_configuration.sls b/test/salt/pillar/examples/nginx_workbench2_configuration.sls
new file mode 100644 (file)
index 0000000..9718a96
--- /dev/null
@@ -0,0 +1,45 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### ARVADOS
+arvados:
+  config:
+    group: www-data
+
+### NGINX
+nginx:
+  ### SITES
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_workbench2_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: workbench2.example.net
+            - listen:
+              - 80
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      arvados_workbench2:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: workbench2.example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - root: /var/www/arvados-workbench2/workbench2
+              - try_files: '$uri $uri/ /index.html'
+              - 'if (-f $document_root/maintenance.html)':
+                - return: 503
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/workbench2.example.net.access.log combined
+            - error_log: {{ nginx_log }}/workbench2.example.net.error.log
diff --git a/test/salt/pillar/examples/nginx_workbench_configuration.sls b/test/salt/pillar/examples/nginx_workbench_configuration.sls
new file mode 100644 (file)
index 0000000..59cec20
--- /dev/null
@@ -0,0 +1,71 @@
+---
+{% set nginx_log = '/var/log/nginx' %}
+
+### ARVADOS
+arvados:
+  config:
+    group: www-data
+
+### NGINX
+nginx:
+  ### SERVER
+  server:
+    config:
+
+      ### STREAMS
+      http:
+        upstream workbench_upstream:
+          - server: '127.0.0.1:9000 fail_timeout=10s'
+
+  ### SITES
+  servers:
+    managed:
+      ### DEFAULT
+      arvados_workbench_default:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: workbench.example.net
+            - listen:
+              - 80
+            - location /.well-known:
+              - root: /var/www
+            - location /:
+              - return: '301 https://$host$request_uri'
+
+      arvados_workbench:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - server_name: workbench.example.net
+            - listen:
+              - 443 http2 ssl
+            - index: index.html index.htm
+            - location /:
+              - proxy_pass: 'http://workbench_upstream'
+              - proxy_read_timeout: 300
+              - proxy_connect_timeout: 90
+              - proxy_redirect: 'off'
+              - proxy_set_header: X-Forwarded-Proto https
+              - proxy_set_header: 'Host $http_host'
+              - proxy_set_header: 'X-Real-IP $remote_addr'
+              - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
+            # - include: 'snippets/letsencrypt.conf'
+            - include: 'snippets/snakeoil.conf'
+            - access_log: {{ nginx_log }}/workbench.example.net.access.log combined
+            - error_log: {{ nginx_log }}/workbench.example.net.error.log
+
+      arvados_workbench_upstream:
+        enabled: true
+        overwrite: true
+        config:
+          - server:
+            - listen: '127.0.0.1:9000'
+            - server_name: workbench
+            - root: /var/www/arvados-workbench/current/public
+            - index:  index.html index.htm
+            - access_log: {{ nginx_log }}/workbench.example.net-upstream.access.log combined
+            - error_log: {{ nginx_log }}/workbench.example.net-upstream.error.log
+
diff --git a/test/salt/pillar/examples/postgresql.sls b/test/salt/pillar/examples/postgresql.sls
new file mode 100644 (file)
index 0000000..6cce4b9
--- /dev/null
@@ -0,0 +1,41 @@
+---
+states:
+  - postgres
+
+### POSTGRESQL
+postgres:
+  use_upstream_repo: false
+  pkgs_extra:
+    - postgresql-contrib
+  postgresconf: |-
+    listen_addresses = '*'  # listen on all interfaces
+  acls:
+    - ['local', 'all', 'postgres', 'peer']
+    - ['local', 'all', 'all', 'peer']
+    - ['host', 'all', 'all', '127.0.0.1/32', 'md5']
+    - ['host', 'all', 'all', '::1/128', 'md5']
+    - ['host', 'arvados', 'arvados', '127.0.0.1/32']
+  users:
+    arvados:
+      ensure: present
+      password: changeme_arvados
+
+  # tablespaces:
+  #   arvados_tablespace:
+  #     directory: /path/to/some/tbspace/arvados_tbsp
+  #     owner: arvados
+
+  databases:
+    arvados:
+      owner: arvados
+      template: template0
+      lc_ctype: en_US.utf8
+      lc_collate: en_US.utf8
+      # tablespace: arvados_tablespace
+      schemas:
+        public:
+          owner: arvados
+      extensions:
+        pg_trgm:
+          if_not_exists: true
+          schema: public
diff --git a/test/salt/states/example_add_snakeoil_certs/init.sls b/test/salt/states/example_add_snakeoil_certs/init.sls
new file mode 100644 (file)
index 0000000..9d7b644
--- /dev/null
@@ -0,0 +1,3 @@
+snake_oil_certs:
+  pkg.installed:
+    - name: ssl-cert