Skip to content

Commit 070ff2b

Browse files
authored
Merge pull request #8 from saltstack-formulas/add_kitchen
Add Kitchen tests
2 parents 984169f + 3fd229c commit 070ff2b

File tree

19 files changed

+265
-108
lines changed

19 files changed

+265
-108
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.kitchen/
2+
Gemfile.lock

.kitchen.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<%
2+
distrib, infos = ENV.fetch('DISTRIB', 'debian:stretch/9').split(':')
3+
codename, version = infos.split('/')
4+
%>
5+
---
6+
driver:
7+
name: docker
8+
use_sudo: false
9+
10+
provisioner:
11+
name: salt_solo
12+
formula: syslog_ng
13+
14+
# Install Salt from official repositories
15+
salt_install: apt
16+
salt_version: latest
17+
salt_apt_repo: http://repo.saltstack.com/apt/<%= distrib %>/<%= version %>/amd64
18+
salt_apt_repo_key: http://repo.saltstack.com/apt/<%= distrib %>/<%= version %>/amd64/latest/SALTSTACK-GPG-KEY.pub
19+
20+
# Don't install Chef
21+
require_chef: false
22+
23+
# Configure Salt
24+
state_top:
25+
base:
26+
'*':
27+
- syslog_ng.config
28+
29+
<% if %w[wheezy jessie xenial].include?(codename) %>
30+
pillars:
31+
top.sls:
32+
base:
33+
'*':
34+
- syslog_ng
35+
syslog_ng.sls:
36+
syslog_ng:
37+
source:
38+
- s_src:
39+
- unix-stream:
40+
- /dev/log
41+
- internal: null
42+
<% end %>
43+
44+
platforms:
45+
- name: <%= distrib %>-<%= codename %>
46+
driver_config:
47+
image: "<%= distrib %>:<%= codename %>"
48+
platform: <%= distrib %>
49+
50+
verifier:
51+
name: inspec
52+
format: progress
53+
54+
suites:
55+
- name: syslog_ng

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: ruby
2+
sudo: required
3+
cache: bundler
4+
rvm:
5+
- 2.3.5
6+
services:
7+
- docker
8+
script:
9+
- bundle exec kitchen test
10+
env:
11+
matrix:
12+
- DISTRIB=debian:wheezy/7
13+
- DISTRIB=debian:jessie/8
14+
- DISTRIB=debian:stretch/9
15+
- DISTRIB=ubuntu:xenial/16.04

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source 'https://rubygems.org'
2+
ruby '2.3.5'
3+
4+
gem 'test-kitchen'
5+
gem 'kitchen-docker'
6+
gem 'kitchen-salt'
7+
gem 'kitchen-inspec'
8+
gem 'rake'

LICENSE

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
Copyright (c) 2013-2015 Salt Stack Formulas
1+
Copyright (c) 2013-2017 Salt Stack Formulas
22

3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
5-
You may obtain a copy of the License at
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
66

7-
http://www.apache.org/licenses/LICENSE-2.0
8-
9-
Unless required by applicable law or agreed to in writing, software
10-
distributed under the License is distributed on an "AS IS" BASIS,
11-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
See the License for the specific language governing permissions and
13-
limitations under the License.
7+
http://www.apache.org/licenses/LICENSE-2.0
148

9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SyslogNG Salt Formula
2+
3+
[![Build Status](https://travis-ci.org/saltstack-formulas/syslog-ng-formula.svg?branch=master)](https://travis-ci.org/saltstack-formulas/syslog-ng-formula)
4+
5+
Install and configure the syslog-ng service.
6+
7+
Note: See the full [Salt Formulas installation and usage instructions](http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html).
8+
9+
## Available states
10+
11+
* `syslog_ng` : Installs the `syslog-ng` package
12+
* `syslog_ng.config` : Installs and configures the `syslog-ng` package
13+
* `syslog_ng.packages` : Install optional packages which may provide additional functionalities
14+
15+
## Available pillars
16+
17+
You can take a loot at [`pillar.example`](https://github.com/saltstack-formulas/syslog-ng-formula/blob/master/pillar.example) to configure SyslogNG with pillars.

README.rst

Lines changed: 0 additions & 33 deletions
This file was deleted.

pillar.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ syslog_ng:
22
module:
33
- tfson
44
include:
5-
- /etc/syslog-ng/conf.d/
5+
- scl.conf
6+
last_include:
7+
- /etc/syslog-ng/conf.d/*.conf
68
version: 3.5
79
options:
810
- threaded: yes
@@ -12,7 +14,7 @@ syslog_ng:
1214
- chain_hostnames: no
1315
- check_hostname: no
1416
source:
15-
- s_internal:
17+
- s_internal:
1618
- internal: null
1719
- s_local:
1820
- unix-stream: /dev/log

syslog_ng/config.sls

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ syslog_ng.conf:
1313
- mode: 644
1414
- watch_in:
1515
- service: syslog_ng
16-

syslog_ng/defaults.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
4+
syslog_ng: {}

0 commit comments

Comments
 (0)