Merge pull request #10 from Martin819/master
Add Kitchen and Travis
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..d1fff6e
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,59 @@
+---
+driver:
+ name: docker
+ hostname: reclass.ci.local
+ use_sudo: false
+
+provisioner:
+ name: salt_solo
+ salt_install: bootstrap
+ salt_bootstrap_url: https://bootstrap.saltstack.com
+ salt_version: latest
+ require_chef: false
+ log_level: error
+ formula: reclass
+ grains:
+ noservices: True
+ state_top:
+ base:
+ "*":
+ - reclass
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - reclass
+
+verifier:
+ name: inspec
+ sudo: true
+
+
+platforms:
+ - name: <%=ENV['PLATFORM'] || 'ubuntu-xenial'%>
+ driver_config:
+ image: <%=ENV['PLATFORM'] || 'trevorj/salty-whales:xenial'%>
+ platform: ubuntu
+
+suites:
+
+ - name: class_mapping
+ provisioner:
+ pillars-from-files:
+ reclass.sls: tests/pillar/class_mapping.sls
+
+ - name: generate_multi
+ provisioner:
+ pillars-from-files:
+ reclass.sls: tests/pillar/generate_multi.sls
+
+ - name: generate_single
+ provisioner:
+ pillars-from-files:
+ reclass.sls: tests/pillar/generate_single.sls
+
+ - name: storage_local
+ provisioner:
+ pillars-from-files:
+ reclass.sls: tests/pillar/storage_local.sls
+# vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..c0a56a3
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,30 @@
+sudo: required
+services:
+ - docker
+
+install:
+ - pip install PyYAML
+ - pip install virtualenv
+ - |
+ test -e Gemfile || cat <<EOF > Gemfile
+ source 'https://rubygems.org'
+ gem 'rake'
+ gem 'test-kitchen'
+ gem 'kitchen-docker'
+ gem 'kitchen-inspec'
+ gem 'inspec'
+ gem 'kitchen-salt', :git => 'https://github.com/epcim/kitchen-salt.git', :branch => 'dependencis-pkg-repo2'
+ #Waiting for PR#78
+ #gem 'kitchen-salt', '>=0.2.25'
+ - bundle install
+
+env:
+ - PLATFORM=trevorj/salty-whales:trusty
+ - PLATFORM=trevorj/salty-whales:xenial
+
+
+before_script:
+ - make test | tail
+
+script:
+ - test ! -e .kitchen.yml || bundle exec kitchen test
diff --git a/reclass/storage/node.sls b/reclass/storage/node.sls
index 6d835e9..df9bdaa 100644
--- a/reclass/storage/node.sls
+++ b/reclass/storage/node.sls
@@ -1,9 +1,6 @@
{%- from "reclass/map.jinja" import storage with context %}
{%- if storage.enabled %}
-{{ storage.base_dir }}/nodes/_generated:
- file.directory
-
{%- for node_name, node in storage.get('node', {}).iteritems() %}
{%- if node.repeat is defined %}
@@ -27,6 +24,7 @@
- user: root
- group: root
- template: jinja
+ - makedirs: True
- defaults:
node: {{ node|yaml }}
node_name: "{{ node_name }}"
@@ -42,6 +40,7 @@
- user: root
- group: root
- template: jinja
+ - makedirs: True
- defaults:
node: {{ node|yaml }}
node_name: "{{ node.get('name', node_name) }}"