service:
name: keepproxy
port: 25100
+ ##### KEEPBALANCE
+ keepbalance:
+ pkg:
+ name: keep-balance
+ service:
+ name: keep-balance
+ port: 9005
##### KEEPWEB
keepweb:
pkg:
{%- if 'Collections' in arvados.cluster %}
{{ arvados.cluster.Collections | yaml(False) | indent(6) }}
{%- endif %}
+ {%- if 'Keepbalance' in arvados.cluster.Services %}
+ BlobTrash: true
+ {%- endif %}
TLS:
Certificate: {{ arvados.cluster.tls.certificate | yaml_encode }}
--- /dev/null
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+ - .service.clean
+ - .package.clean
--- /dev/null
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+ - .package
+ - ..config
+ - .service
--- /dev/null
+# -*- 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-keepbalance-package-clean-pkg-removed:
+ pkg.removed:
+ - name: {{ arvados.keepbalance.pkg.name }}
--- /dev/null
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+ - .install
--- /dev/null
+# -*- 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-keepbalance-package-install-pkg-installed:
+ pkg.installed:
+ - name: {{ arvados.keepbalance.pkg.name }}
+ - version: {{ arvados.version }}
+ - refresh: true
--- /dev/null
+# -*- 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-keepbalance-service-clean-service-dead:
+ service.dead:
+ - name: {{ arvados.service.name }}
+ - enable: False
+ - require_in:
+ - pkg: arvados-keepbalance-package-clean-pkg-removed
--- /dev/null
+# -*- coding: utf-8 -*-
+# vim: ft=sls
+
+include:
+ - .running
--- /dev/null
+# -*- 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-keepbalance-service-running-service-running:
+ service.running:
+ - name: {{ arvados.keepbalance.service.name }}
+ - enable: True
+ - watch:
+ - sls: {{ sls_config_file }}
+ - require:
+ - pkg: arvados-keepbalance-package-install-pkg-installed
- arvados.keepweb
- arvados.controller
- arvados.dispatcher
+ - arvados.keepbalance
pillars:
top.sls:
base:
- path: test/integration/keepproxy
- path: test/integration/keepweb
- path: test/integration/controller
+ - path: test/integration/keepbalance
#### workbench,workbench2,webshell
- name: workbench
driver:
--- /dev/null
+# InSpec Profile: `keepbalance`
+
+This shows the implementation of the `keepbalance` 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 keepbalance
+Summary
+-------
+Location: keepbalance
+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 keepbalance
+..
+
+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 keepbalance --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).
--- /dev/null
+# frozen_string_literal: true
+
+keepbalance_stanza = <<-KEEPBALANCE_STANZA
+ Keepbalance:
+ InternalURLs:
+ http://fixme.example.net:9005: {}
+KEEPBALANCE_STANZA
+
+collections_stanza = <<-COLLECTIONS_STANZA
+ Collections:
+ BlobSigningKey: "blobsigningkeymushaveatleast32characters"
+ BlobTrash: true
+COLLECTIONS_STANZA
+
+group = case os[:name]
+ when 'centos'
+ 'nginx'
+ when 'debian', 'ubuntu'
+ 'www-data'
+ end
+
+control 'arvados configuration' do
+ title 'should match desired keepbalance 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 group }
+ 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(keepbalance_stanza) }
+ its('content') { should include(collections_stanza) }
+ end
+end
--- /dev/null
+# frozen_string_literal: true
+
+control 'arvados keepbalance package' do
+ title 'should be installed'
+
+ describe package('keep-balance') do
+ it { should be_installed }
+ end
+end
--- /dev/null
+# frozen_string_literal: true
+
+control 'arvados keepbalance service' do
+ impact 0.5
+ title 'should be running and enabled'
+
+ describe service('keep-balance') do
+ it { should be_enabled }
+ it { should be_running }
+ end
+ describe port(9_005) do
+ it { should be_listening }
+ its('processes') { should cmp 'keep-balance' }
+ end
+end
--- /dev/null
+# -*- coding: utf-8 -*-
+# vim: ft=yaml
+---
+name: keepbalance
+title: arvados formula keepbalance submodule
+maintainer: SaltStack Formulas
+license: Apache-2.0
+summary: Verify that the arvados formula keepbalance is setup and configured correctly
+supports:
+ - platform-name: debian
+ - platform-name: ubuntu
+ - platform-name: centos