Add Salt 2018.3 tests
Change-Id: I9326d024809990b87482f08e2be93145cdeb8af1
diff --git a/.kitchen.yml b/.kitchen.yml
index 96ea71d..9b48880 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -45,7 +45,7 @@
platforms:
- name: <%=ENV['PLATFORM'] || 'saltstack-ubuntu-xenial-salt-stable' %>
driver_config:
- image: <%=ENV['PLATFORM'] || 'epcim/salt-formulas:saltstack-ubuntu-xenial-salt-stable'%>
+ image: <%=ENV['PLATFORM'] || 'epcim/salt:saltstack-ubuntu-xenial-salt-stable'%>
platform: ubuntu
suites:
diff --git a/.travis.yml b/.travis.yml
index 28df064..57426fa 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,15 +20,21 @@
- bundle install
env:
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 SUITE=client-compose
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 SUITE=client-container
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 SUITE=host-single
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=client-compose
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=client-container
- - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 SUITE=host-single
-# - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=client-compose
-# - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=client-container
-# - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-bionic-salt-2017.7 SUITE=host-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 SUITE=client-compose
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 SUITE=client-container
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 SUITE=host-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=client-compose
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=client-container
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=host-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=client-compose
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=client-container
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=host-single
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=client-compose
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=client-container
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=host-single
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=client-compose
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=client-container
+# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=host-single
before_script:
- make test | tail
diff --git a/docker/client/container.sls b/docker/client/container.sls
index cf47819..52cab03 100644
--- a/docker/client/container.sls
+++ b/docker/client/container.sls
@@ -8,8 +8,10 @@
{%- set id = name %}
{%- set required_containers = [] %}
+{%- if not grains.get('noservices') %}
+
{{id}}_image:
- {%- if grains['saltversioninfo'][0] >= 2017 %}
+ {%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
docker_image.present:
{%- else %}
dockerng.image_present:
@@ -19,37 +21,38 @@
- build: {{ container.build }}
{%- endif %}
- force: {{ container.force|default(False) }}
- {%- if grains.get('noservices') %}
- - onlyif: /bin/false
- {%- endif %}
- require:
- pkg: docker_python
+{%- endif %}
+
{%- set binds = {} %}
{%- set volumes = {} %}
{%- for volume in container.get('volumes', []) %}
-{%- set volume_parts = volume.split(':') %}
-{%- set path = volume_parts[0] %}
+ {%- set volume_parts = volume.split(':') %}
+ {%- set path = volume_parts[0] %}
-{%- if volume_parts is iterable and volume_parts|length > 1 %}
-{# volume is bind #}
-{%- do binds.update({volume:volume}) %}
-{%- else %}
-{%- do volumes.update({volume:volume}) %}
-{%- endif %}
+ {%- if volume_parts is iterable and volume_parts|length > 1 %}
+ {# volume is bind #}
+ {%- do binds.update({volume:volume}) %}
+ {%- else %}
+ {%- do volumes.update({volume:volume}) %}
+ {%- endif %}
-{%- if path.startswith('/') and container.makedirs|default(True) %}
+ {%- if path.startswith('/') and container.makedirs|default(True) %}
{{ id }}_volume_{{ path }}:
file.directory:
- name: {{ path }}
- makedirs: true
-{%- endif %}
+ {%- endif %}
{%- endfor %}
+{%- if not grains.get('noservices') %}
+
{{id}}_container:
- {%- if grains['saltversioninfo'][0] >= 2017 %}
+ {%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
docker_container.running:
{%- else %}
dockerng.running:
@@ -58,9 +61,6 @@
- start: {{ container.start|default(True) }}
- user: {{ container.user|default("root") }}
- image: {{container.image}}
- {%- if grains.get('noservices') %}
- - onlyif: /bin/false
- {%- endif %}
{%- if 'command' in container %}
- command: {{container.command}}
{%- endif %}
@@ -107,14 +107,14 @@
- restart_policy: {{ container.restart }}
{%- endif %}
- watch:
- {%- if grains['saltversioninfo'][0] >= 2017 %}
+ {%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
- docker_image: {{id}}_image
{%- else %}
- dockerng: {{id}}_image
- {%- endif %}
+ {%- endif %}
{%- if required_containers is defined %}
{%- for containerid in required_containers %}
- {%- if grains['saltversioninfo'][0] >= 2017 %}
+ {%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
- docker_container: {{containerid}}
{%- else %}
- dockerng: {{containerid}}
@@ -127,4 +127,6 @@
{%- endif %}
{%- endfor %}
+{%- endif %}
+
{% endfor %}