Added Kitchen and Travis
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..6e852bd
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,149 @@
+---
+driver:
+ name: docker
+ hostname: salt.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: salt
+ grains:
+ noservices: true
+ state_top:
+ base:
+ "*":
+ - salt
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - salt
+ - common
+ common.sls:
+ salt:
+ minion:
+ enabled: true
+ master:
+ host: localhost
+ linux:
+ system:
+ enabled: true
+ name: salt
+ domain: ci.local
+ dependencies:
+ - name: git
+ repo: git
+ source: https://github.com/salt-formulas/salt-formula-git.git
+ - name: reclass
+ repo: git
+ source: https://github.com/salt-formulas/salt-formula-reclass.git
+
+verifier:
+ name: inspec
+ sudo: true
+
+platforms:
+ - name: <%=ENV['PLATFORM'] || 'ubuntu-xenial'%>
+ driver_config:
+ image: <%=ENV['PLATFORM'] || 'trevorj/salty-whales:xenial'%>
+ platform: ubuntu
+
+# - name: ubuntu-xenial
+# driver_config:
+# image: trevorj/salty-whales:xenial
+# platform: ubuntu
+
+# - name: debian-jessie
+# driver_config:
+# image: debian:jessie
+
+# - name: debian-stretch
+# driver_config:
+# image: debian:stretch
+
+suites:
+
+ - name: minion-default
+ provisioner:
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - common
+ - minion_pki
+ - minion_mine
+ - minion_graph
+ - minion_handler
+ - minion_local_pillar
+ - minion_local_reclass
+ pillars-from-files:
+ minion_pki.sls: tests/pillar/minion_pki_ca.sls
+ minion_mine.sls: tests/pillar/minion_mine.sls
+ minion_graph.sls: tests/pillar/minion_graph.sls
+ minion_handler.sls: tests/pillar/minion_custom_handler.sls
+ minion_local_pillar.sls: tests/pillar/minion_local_pillar.sls
+ minion_local_reclass.sls: tests/pillar/minion_local_reclass.sls
+
+ - name: master-default
+ provisioner:
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - common
+ - master_api
+ - master_acl
+ - master_ssh_key
+ - master_ssh_password
+ - master_ssh_root
+ - master_handler
+ pillars-from-files:
+ master_api.sls: tests/pillar/master_api.sls
+ master_acl.sls: tests/pillar/master_acl.sls
+ master_ssh_key.sls: tests/pillar/master_ssh_minion_key.sls
+ master_ssh_password.sls: tests/pillar/master_ssh_minion_password.sls
+ master_ssh_root.sls: tests/pillar/master_ssh_minion_root.sls
+ master_handler.sls: tests/pillar/master_custom_handler.sls
+
+ - name: control-default
+ provisioner:
+ grains:
+ noservices: true
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - common
+ - control_cloud_digitalocean
+ - control_cloud_openstack
+ - control_virt
+ pillars-from-files:
+ control_cloud_digitalocean.sls: tests/pillar/control_cloud_digitalocean.sls
+ control_cloud_openstack.sls: tests/pillar/control_cloud_openstack.sls
+ control_virt.sls: tests/pillar/control_virt.sls
+
+ - name: minion_multi_master_failover
+ provisioner:
+ pillars-from-files:
+ salt.sls: tests/pillar/minion_multi_master_failover.sls
+
+
+# - name: minion-local
+# provisioner:
+# pillars:
+# top.sls:
+# base:
+# "*":
+# - common
+# - minion_local_pillar
+# - minion_local_reclass
+# pillars-from-files:
+# minion_local_pillar.sls: tests/pillar/minion_local_pillar.sls
+# minion_local_reclass.sls: tests/pillar/minion_local_reclass.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..cb13cc5
--- /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 converge || true
+ - test ! -e .kitchen.yml || bundle exec kitchen verify
diff --git a/salt/control/virt.sls b/salt/control/virt.sls
index da93038..0bb9f80 100644
--- a/salt/control/virt.sls
+++ b/salt/control/virt.sls
@@ -32,8 +32,10 @@
- template: jinja
- require:
- pkg: salt_control_virt_packages
+ {%- if not grains.get('noservices', False) %}
- watch_in:
- service: salt_minion_service
+ {%- endif %}
{%- for cluster_name, cluster in control.cluster.iteritems() %}
diff --git a/salt/minion/ca.sls b/salt/minion/ca.sls
index 0a7e61a..b39323e 100644
--- a/salt/minion/ca.sls
+++ b/salt/minion/ca.sls
@@ -10,8 +10,10 @@
- template: jinja
- require:
- {{ minion.install_state }}
+ {%- if not grains.get('noservices', False) %}
- watch_in:
- service: salt_minion_service
+ {%- endif %}
{%- for ca_name,ca in minion.ca.iteritems() %}
diff --git a/salt/minion/service.sls b/salt/minion/service.sls
index 5c458b1..facb9c8 100644
--- a/salt/minion/service.sls
+++ b/salt/minion/service.sls
@@ -26,12 +26,16 @@
- template: jinja
- require:
- {{ minion.install_state }}
+ {%- if not grains.get('noservices', False) %}
- watch_in:
- service: salt_minion_service
+ {%- endif %}
+{%- if not grains.get('noservices', False) %}
salt_minion_service:
- service.running:
- - name: {{ minion.service }}
- - enable: true
+ service.running:
+ - name: {{ minion.service }}
+ - enable: true
+{%- endif %}
{%- endif %}
diff --git a/tests/pillar/master_acl.sls b/tests/pillar/master_acl.sls
index d457f5c..b33a3d7 100644
--- a/tests/pillar/master_acl.sls
+++ b/tests/pillar/master_acl.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_api.sls b/tests/pillar/master_api.sls
index b5bd653..6be5097 100644
--- a/tests/pillar/master_api.sls
+++ b/tests/pillar/master_api.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_cluster_failover.sls b/tests/pillar/master_cluster_failover.sls
index 88229a0..216439c 100644
--- a/tests/pillar/master_cluster_failover.sls
+++ b/tests/pillar/master_cluster_failover.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_custom_handler.sls b/tests/pillar/master_custom_handler.sls
index 80abf33..b07ea82 100644
--- a/tests/pillar/master_custom_handler.sls
+++ b/tests/pillar/master_custom_handler.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_ssh_minion_key.sls b/tests/pillar/master_ssh_minion_key.sls
index 86d328e..30cfb21 100644
--- a/tests/pillar/master_ssh_minion_key.sls
+++ b/tests/pillar/master_ssh_minion_key.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_ssh_minion_password.sls b/tests/pillar/master_ssh_minion_password.sls
index fcb0cd5..6ec5dfd 100644
--- a/tests/pillar/master_ssh_minion_password.sls
+++ b/tests/pillar/master_ssh_minion_password.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/master_ssh_minion_root.sls b/tests/pillar/master_ssh_minion_root.sls
index e12681f..c469318 100644
--- a/tests/pillar/master_ssh_minion_root.sls
+++ b/tests/pillar/master_ssh_minion_root.sls
@@ -6,6 +6,8 @@
enabled: true
salt:
master:
+ command_timeout: 5
+ worker_threads: 2
enabled: true
source:
engine: pkg
diff --git a/tests/pillar/salt_master_peer.sls b/tests/pillar/salt_master_peer.sls
deleted file mode 100644
index e69de29..0000000
--- a/tests/pillar/salt_master_peer.sls
+++ /dev/null