test: use OS environment variable for kitchen

This commit is contained in:
Adrien Waksberg 2019-02-17 09:27:49 +01:00
parent 7835763dff
commit 2c9df1967d
3 changed files with 17 additions and 29 deletions

View file

@ -1,4 +1,8 @@
---
# <% os = ENV['OS'] || 'debian9' %>
# <% ansible = ENV['ANSIBLE_VERSION'] || '2.7' %>
# <% command = os == 'centos7' ? '/usr/sbin/init' : '/bin/systemd' %>
driver:
name: docker_cli
@ -15,38 +19,19 @@ provisioner:
ansible_inventory: ./test/integration/inventory
platforms:
- name: debian9
- name: <%= os %>
driver_config:
image: "nishiki/debian9:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
command: /bin/systemd
image: "nishiki/<%= os %>:ansible-<%= ansible %>"
command: <%= command %>
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
security_opt: seccomp=unconfined
# <% if os == 'debian9' %>
provisioner:
extra_vars:
sensu_repository_system: ubuntu
sensu_repository_release: xenial
- name: ubuntu18.04
driver_config:
image: "nishiki/ubuntu18.04:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
command: /bin/systemd
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
security_opt: seccomp=unconfined
- name: ubuntu16.04
driver_config:
image: "nishiki/ubuntu16.04:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
command: /bin/systemd
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
security_opt: seccomp=unconfined
- name: centos7
driver_config:
image: "nishiki/centos7:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.7' %>"
command: /usr/sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
security_opt: seccomp=unconfined
# <% end %>
suites:
- name: default

View file

@ -3,9 +3,12 @@ sudo: required
language: ruby
env:
- ANSIBLE_VERSION=2.5
- ANSIBLE_VERSION=2.6
- ANSIBLE_VERSION=2.7
- OS=debian9 ANSIBLE_VERSION=2.5
- OS=debian9 ANSIBLE_VERSION=2.6
- OS=debian9 ANSIBLE_VERSION=2.7
- OS=ubuntu18.04 ANSIBLE_VERSION=2.7
- OS=ubuntu16.04 ANSIBLE_VERSION=2.7
- OS=centos7 ANSIBLE_VERSION=2.7
services:
- docker
@ -19,7 +22,7 @@ before_install:
script:
- kitchen conv
- kitchen conv default-debian9 | grep changed=0
- kitchen conv | grep changed=0
- kitchen verify
- ansible-lint -r galaxy-lint-rules/rules .
- yamllint .

View file

@ -2,7 +2,7 @@
extends: default
ignore: |
.kitchen/*
.kitchen*
vendor/
rules: