Procházet zdrojové kódy

Merge pull request #23 from n-rodriguez/wip/kitchen

Upgrade formula to new standards
tags/v0.4.0
Imran Iqbal před 5 roky
rodič
revize
fa3260124e
Žádný účet není propojen s e-mailovou adresou tvůrce revize
27 změnil soubory, kde provedl 374 přidání a 123 odebrání
  1. +11
    -7
      .cirrus.yml
  2. +17
    -13
      docs/README.rst
  3. +21
    -2
      kitchen.yml
  4. +0
    -15
      syslog_ng/config.sls
  5. +23
    -0
      syslog_ng/config/file.sls
  6. +5
    -0
      syslog_ng/config/init.sls
  7. +8
    -0
      syslog_ng/defaults.yaml
  8. +0
    -4
      syslog_ng/defaults.yml
  9. +6
    -2
      syslog_ng/files/syslog-ng.conf
  10. +6
    -10
      syslog_ng/init.sls
  11. +42
    -14
      syslog_ng/map.jinja
  12. +0
    -20
      syslog_ng/os_family_map.yml
  13. +35
    -0
      syslog_ng/osarchmap.yaml
  14. +8
    -0
      syslog_ng/osfamilymap.yaml
  15. +30
    -4
      syslog_ng/osfingermap.yaml
  16. +13
    -0
      syslog_ng/osmap.yaml
  17. +5
    -0
      syslog_ng/package/init.sls
  18. +34
    -0
      syslog_ng/package/install.sls
  19. +0
    -15
      syslog_ng/packages.sls
  20. +5
    -0
      syslog_ng/service/init.sls
  21. +17
    -0
      syslog_ng/service/running.sls
  22. +31
    -0
      test/integration/default/controls/config_spec.rb
  23. +7
    -0
      test/integration/default/controls/package_spec.rb
  24. +16
    -0
      test/integration/default/controls/service_spec.rb
  25. +0
    -17
      test/integration/default/controls/syslog_ng.rb
  26. +1
    -0
      test/integration/default/inspec.yml
  27. +33
    -0
      test/salt/pillar/syslog_ng.sls

+ 11
- 7
.cirrus.yml Zobrazit soubor

env: env:
matrix: matrix:
- INSTANCE: default-debian-10-develop-py3 - INSTANCE: default-debian-10-develop-py3
- INSTANCE: default-ubuntu-1804-develop-py3
# - INSTANCE: default-ubuntu-1804-develop-py3
# - INSTANCE: default-centos-7-develop-py3 # - INSTANCE: default-centos-7-develop-py3
# - INSTANCE: default-fedora-30-develop-py3 # - INSTANCE: default-fedora-30-develop-py3
# - INSTANCE: default-opensuse-leap-15-develop-py3 # - INSTANCE: default-opensuse-leap-15-develop-py3
# - INSTANCE: default-amazonlinux-2-develop-py2 # - INSTANCE: default-amazonlinux-2-develop-py2
- INSTANCE: default-debian-9-2019-2-py3
# - INSTANCE: default-arch-base-latest-develop-py2
# - INSTANCE: default-debian-9-2019-2-py3
- INSTANCE: default-ubuntu-1804-2019-2-py3 - INSTANCE: default-ubuntu-1804-2019-2-py3
# - INSTANCE: default-centos-7-2019-2-py3 # - INSTANCE: default-centos-7-2019-2-py3
# - INSTANCE: default-fedora-30-2019-2-py3 # - INSTANCE: default-fedora-30-2019-2-py3
# - INSTANCE: default-opensuse-leap-15-2019-2-py3 # - INSTANCE: default-opensuse-leap-15-2019-2-py3
# - INSTANCE: default-amazonlinux-2-2019-2-py2
- INSTANCE: default-debian-9-2018-3-py2
- INSTANCE: default-amazonlinux-2-2019-2-py2
- INSTANCE: default-arch-base-latest-2019-2-py2
# - INSTANCE: default-debian-9-2018-3-py2
# - INSTANCE: default-ubuntu-1604-2018-3-py2 # - INSTANCE: default-ubuntu-1604-2018-3-py2
# - INSTANCE: default-centos-7-2018-3-py2 # - INSTANCE: default-centos-7-2018-3-py2
# - INSTANCE: default-fedora-29-2018-3-py2
# - INSTANCE: default-opensuse-leap-15-2018-3-py2
- INSTANCE: default-fedora-29-2018-3-py2
- INSTANCE: default-opensuse-leap-15-2018-3-py2
# - INSTANCE: default-amazonlinux-2-2018-3-py2 # - INSTANCE: default-amazonlinux-2-2018-3-py2
# - INSTANCE: default-arch-base-latest-2018-3-py2
# - INSTANCE: default-debian-8-2017-7-py2 # - INSTANCE: default-debian-8-2017-7-py2
# - INSTANCE: default-ubuntu-1604-2017-7-py2 # - INSTANCE: default-ubuntu-1604-2017-7-py2
# - INSTANCE: default-centos-6-2017-7-py2
- INSTANCE: default-centos-6-2017-7-py2
# - INSTANCE: default-fedora-29-2017-7-py2 # - INSTANCE: default-fedora-29-2017-7-py2
# - INSTANCE: default-opensuse-leap-15-2017-7-py2 # - INSTANCE: default-opensuse-leap-15-2017-7-py2
# - INSTANCE: default-amazonlinux-2-2017-7-py2 # - INSTANCE: default-amazonlinux-2-2017-7-py2
# - INSTANCE: default-arch-base-latest-2017-7-py2
bundle_install_script: bundle install bundle_install_script: bundle install
verify_script: verify_script:
- bin/kitchen verify ${INSTANCE} - bin/kitchen verify ${INSTANCE}

+ 17
- 13
docs/README.rst Zobrazit soubor

^^^^^^^^^^^^^ ^^^^^^^^^^^^^
Installs and configures the syslog_ng package. Installs and configures the syslog_ng package.


``syslog_ng.packages``
``syslog_ng.package``
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
Installs the syslog_ng package and optional packages which may provide additional functionalities. Installs the syslog_ng package and optional packages which may provide additional functionalities.


^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
This state manages the file ``syslog_ng.conf`` under ``/etc/syslog-ng`` (template found in "syslog_ng/files"). The configuration is populated by values in "syslog_ng/map.jinja" based on the package's default values (and RedHat, Debian, Suse and Arch family distribution specific values), which can then be overridden by values of the same name in pillar. This state manages the file ``syslog_ng.conf`` under ``/etc/syslog-ng`` (template found in "syslog_ng/files"). The configuration is populated by values in "syslog_ng/map.jinja" based on the package's default values (and RedHat, Debian, Suse and Arch family distribution specific values), which can then be overridden by values of the same name in pillar.


``syslog_ng.service``
^^^^^^^^^^^^^^^^^^^^
Manages the startup and running state of the syslog_ng service.

Testing Testing
------- -------




$ gem install bundler $ gem install bundler
$ bundle install $ bundle install
$ bundle exec kitchen test [platform]
$ bin/kitchen test [platform]


Where ``[platform]`` is the platform name defined in ``kitchen.yml``, Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
e.g. ``debian-9-2019-2-py3``. e.g. ``debian-9-2019-2-py3``.


``kitchen converge``
^^^^^^^^^^^^^^^^^^^^
``bin/kitchen converge``
^^^^^^^^^^^^^^^^^^^^^^^^


Creates the docker instance and runs the ``template`` main state, ready for testing.
Creates the docker instance and runs the ``syslog_ng`` main state, ready for testing.


``kitchen verify``
^^^^^^^^^^^^^^^^^^
``bin/kitchen verify``
^^^^^^^^^^^^^^^^^^^^^^


Runs the ``inspec`` tests on the actual instance. Runs the ``inspec`` tests on the actual instance.


``kitchen destroy``
^^^^^^^^^^^^^^^^^^^
``bin/kitchen destroy``
^^^^^^^^^^^^^^^^^^^^^^^


Removes the docker instance. Removes the docker instance.


``kitchen test``
^^^^^^^^^^^^^^^^
``bin/kitchen test``
^^^^^^^^^^^^^^^^^^^^


Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``. Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.


``kitchen login``
^^^^^^^^^^^^^^^^^
``bin/kitchen login``
^^^^^^^^^^^^^^^^^^^^^


Gives you SSH access to the instance for manual testing. Gives you SSH access to the instance for manual testing.

+ 21
- 2
kitchen.yml Zobrazit soubor

provision_command: provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python2 git develop - sh bootstrap-salt.sh -XdPbfrq -x python2 git develop
- name: arch-base-latest-develop-py2
driver:
image: netmanagers/salt-develop-py2:arch-base-latest
provision_command:
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python2 git develop
run_command: /usr/lib/systemd/systemd


## SALT `2019.2` ## SALT `2019.2`
- name: debian-9-2019-2-py3 - name: debian-9-2019-2-py3
- name: amazonlinux-2-2019-2-py2 - name: amazonlinux-2-2019-2-py2
driver: driver:
image: netmanagers/salt-2019.2-py2:amazonlinux-2 image: netmanagers/salt-2019.2-py2:amazonlinux-2
- name: arch-base-latest-2019-2-py2
driver:
image: netmanagers/salt-2019.2-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd


## SALT `2018.3` ## SALT `2018.3`
- name: debian-9-2018-3-py2 - name: debian-9-2018-3-py2
- name: amazonlinux-2-2018-3-py2 - name: amazonlinux-2-2018-3-py2
driver: driver:
image: netmanagers/salt-2018.3-py2:amazonlinux-2 image: netmanagers/salt-2018.3-py2:amazonlinux-2
- name: arch-base-latest-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd


## SALT `2017.7` ## SALT `2017.7`
- name: debian-8-2017-7-py2 - name: debian-8-2017-7-py2
- name: amazonlinux-2-2017-7-py2 - name: amazonlinux-2-2017-7-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:amazonlinux-2 image: netmanagers/salt-2017.7-py2:amazonlinux-2
- name: arch-base-latest-2017-7-py2
driver:
image: netmanagers/salt-2017.7-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd


provisioner: provisioner:
name: salt_solo name: salt_solo
state_top: state_top:
base: base:
'*': '*':
- syslog_ng.config
- syslog_ng
pillars: pillars:
top.sls: top.sls:
base: base:
'*': '*':
- syslog_ng - syslog_ng
pillars_from_files: pillars_from_files:
syslog_ng.sls: pillar.example
syslog_ng.sls: test/salt/pillar/syslog_ng.sls
verifier: verifier:
inspec_tests: inspec_tests:
- path: test/integration/default - path: test/integration/default

+ 0
- 15
syslog_ng/config.sls Zobrazit soubor

{% from "syslog_ng/map.jinja" import syslog_ng with context %}

include:
- syslog_ng

syslog_ng.conf:
file.managed:
- name: {{ syslog_ng.syslog_ng_config }}
- source: {{ syslog_ng.syslog_ng_config_src }}
- template: jinja
- user: root
- group: root
- mode: 644
- watch_in:
- service: syslog_ng

+ 23
- 0
syslog_ng/config/file.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- from tplroot ~ "/map.jinja" import syslog_ng with context %}

include:
- {{ sls_package_install }}

syslog_ng/config/install:
file.managed:
- name: {{ syslog_ng.syslog_ng_config }}
- source: {{ syslog_ng.syslog_ng_config_src }}
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- sls: {{ sls_package_install }}
- context:
syslog_ng: {{ syslog_ng | json }}

+ 5
- 0
syslog_ng/config/init.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .file

+ 8
- 0
syslog_ng/defaults.yaml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng:
package: syslog-ng
service: syslog-ng
syslog_ng_config: /etc/syslog-ng/syslog-ng.conf
syslog_ng_config_src: salt://syslog_ng/files/syslog-ng.conf

+ 0
- 4
syslog_ng/defaults.yml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng: {}

+ 6
- 2
syslog_ng/files/syslog-ng.conf Zobrazit soubor

{%- from "syslog_ng/macro.jinja" import rule_builder -%}
{%- from "syslog_ng/map.jinja" import syslog_ng with context -%}
########################################################################
# File managed by Salt at <{{ source }}>.
# Your changes will be overwritten.
########################################################################

{%- from "syslog_ng/macro.jinja" import rule_builder %}


@version: {{ syslog_ng.get('version', '3.3') }} @version: {{ syslog_ng.get('version', '3.3') }}



+ 6
- 10
syslog_ng/init.sls Zobrazit soubor

{% from "syslog_ng/map.jinja" import syslog_ng with context %}
# -*- coding: utf-8 -*-
# vim: ft=sls


syslog_ng:
pkg.installed:
- name: {{ syslog_ng.package }}

service.running:
- enable: True
- name: {{ syslog_ng.service }}
- watch:
- pkg: syslog_ng
include:
- .package
- .config
- .service

+ 42
- 14
syslog_ng/map.jinja Zobrazit soubor

# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=jinja # vim: ft=jinja


{% import_yaml "syslog_ng/defaults.yml" as defaults %}
{% import_yaml "syslog_ng/os_family_map.yml" as os_family_map %}
{% import_yaml "syslog_ng/os_codename_map.yml" as os_codename_map %}
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}


{# get the settings for the os_family grain #}
{% set osfam = salt['grains.filter_by'](os_family_map) or {} %}
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get'](tplroot, default={}) %}


{# get the settings for the oscodename grain, os_family data will override oscodename data #}
{% set oscode = salt['grains.filter_by'](os_codename_map, grain='oscodename', merge=osfam) or {} %}
{%- set defaults = salt['grains.filter_by'](
default_settings,
default=tplroot,
merge=salt['grains.filter_by'](
osarchmap,
grain='osarch',
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
merge=salt['grains.filter_by'](
osmap,
grain='os',
merge=salt['grains.filter_by'](
osfingermap,
grain='osfinger',
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)
)
)
%}


{# merge the os family/os codename specific data over the defaults #}
{% do defaults.syslog_ng.update(oscode) %}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}


{# merge the pillar:lookup dict into the defaults/os specific dict #}
{% set lookup = salt['pillar.get']('syslog_ng:lookup', default=defaults.syslog_ng, merge=True) %}

{# merge the actual syslog_ng pillar into the above combined dict #}
{% set syslog_ng = salt['pillar.get']('syslog_ng', default=lookup, merge=True) %}
{%- set syslog_ng = config %}

+ 0
- 20
syslog_ng/os_family_map.yml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
Debian:
package: syslog-ng
service: syslog-ng
syslog_ng_config: /etc/syslog-ng/syslog-ng.conf
syslog_ng_config_src: salt://syslog_ng/files/syslog-ng.conf

Gentoo:
package: app-admin/syslog-ng
service: syslog-ng
syslog_ng_config: /etc/syslog-ng/syslog-ng.conf
syslog_ng_config_src: salt://syslog_ng/files/syslog-ng.conf

RedHat:
package: syslog-ng
service: syslog-ng
syslog_ng_config: /etc/syslog-ng/syslog-ng.conf
syslog_ng_config_src: salt://syslog_ng/files/syslog-ng.conf

+ 35
- 0
syslog_ng/osarchmap.yaml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['osarch'] based logic.
# You just need to add the key:values for an `osarch` that differ
# from `defaults.yaml`.
# Only add an `osarch` which is/will be supported by the formula.
#
# If you do not need to provide defaults via the `osarch` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osarch: {}
---
amd64:
arch: amd64

x86_64:
arch: amd64

386:
arch: 386

arm64:
arch: arm64

armv6l:
arch: armv6l

armv7l:
arch: armv7l

ppc64le:
arch: ppc64le

s390x:
arch: s390x

+ 8
- 0
syslog_ng/osfamilymap.yaml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
Gentoo:
package: app-admin/syslog-ng

Arch:
service: syslog-ng@default.service

syslog_ng/os_codename_map.yml → syslog_ng/osfingermap.yaml Zobrazit soubor

# vim: ft=yaml # vim: ft=yaml
--- ---
# Debian # Debian
wheezy:
Debian-7:
version: 3.3 version: 3.3
include: include:
- scl.conf - scl.conf
last_include: last_include:
- /etc/syslog-ng/conf.d/ - /etc/syslog-ng/conf.d/


jessie:
Debian-8:
version: 3.5 version: 3.5
include: include:
- scl.conf - scl.conf
last_include: last_include:
- /etc/syslog-ng/conf.d/*.conf - /etc/syslog-ng/conf.d/*.conf


stretch:
Debian-9:
version: 3.8 version: 3.8
include: include:
- scl.conf - scl.conf
last_include: last_include:
- /etc/syslog-ng/conf.d/*.conf - /etc/syslog-ng/conf.d/*.conf


Debian-10:
version: 3.12
include:
- scl.conf
last_include:
- /etc/syslog-ng/conf.d/*.conf

# Ubuntu # Ubuntu
xenial:
Ubuntu-16.04:
version: 3.5 version: 3.5
include: include:
- scl.conf - scl.conf
- '`scl-root`/system/tty10.conf' - '`scl-root`/system/tty10.conf'
last_include: last_include:
- /etc/syslog-ng/conf.d/*.conf - /etc/syslog-ng/conf.d/*.conf

Ubuntu-18.04:
version: 3.13
include:
- scl.conf
last_include:
- /etc/syslog-ng/conf.d/*.conf

# Suse
Leap-15:
version: 3.19
include:
- scl.conf
last_include:
- /etc/syslog-ng/conf.d/

# CentOS
CentOS-6:
version: 3.2

+ 13
- 0
syslog_ng/osmap.yaml Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['os'] based logic.
# You just need to add the key:values for an `os` that differ
# from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`.
# Only add an `os` which is/will be supported by the formula.
#
# If you do not need to provide defaults via the `os` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osmap: {}
---
osmap: {}

+ 5
- 0
syslog_ng/package/init.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install

+ 34
- 0
syslog_ng/package/install.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import syslog_ng with context %}

{#- Simulating `grains.osfinger`, which is avoided since not available in all distros #}
{%- if [grains.os, grains.osrelease] == ['Amazon', '2'] %}
syslog_ng/package/repo:
pkgrepo.managed:
- name: epel
- humanname: Extra Packages for Enterprise Linux 7 - $basearch
- mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
- enabled: 1
- gpgcheck: 1
- gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
- failovermethod: priority
- require_in:
- pkg: syslog_ng/package/install
{%- endif %}

syslog_ng/package/install:
pkg.installed:
- name: {{ syslog_ng.package }}

{%- if syslog_ng.packages is defined and syslog_ng.packages %}
syslog_ng/packages/install:
pkg.installed:
- pkgs:
{%- for pkg in syslog_ng.packages %}
- {{ pkg.name }}{% if pkg.version is defined and pkg.version %}: '{{ pkg.version }}' {% endif %}
{%- endfor %}
{%- endif %}

+ 0
- 15
syslog_ng/packages.sls Zobrazit soubor

{% from "syslog_ng/map.jinja" import syslog_ng with context %}

include:
- syslog_ng

{%- if syslog_ng.packages is defined and syslog_ng.packages %}
syslog_ng_packages:
pkg.installed:
- pkgs:
{%- for pkg in syslog_ng.packages %}
- {{ pkg.name }}{% if pkg.version is defined and pkg.version %}: '{{ pkg.version }}' {% endif %}
{%- endfor %}
- watch_in:
- service: syslog_ng
{%- endif %}

+ 5
- 0
syslog_ng/service/init.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .running

+ 17
- 0
syslog_ng/service/running.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- from tplroot ~ "/map.jinja" import syslog_ng with context %}

include:
- {{ sls_config_file }}

syslog_ng/service/running:
service.running:
- name: {{ syslog_ng.service }}
- enable: true
- require:
- sls: {{ sls_config_file }}

+ 31
- 0
test/integration/default/controls/config_spec.rb Zobrazit soubor

control 'SyslogNG configuration' do
title 'should match desired lines'

str =
'''
source s_src {
internal();
};

destination d_syslog {
file("/var/log/syslog");
};

filter f_syslog3 {
not level(debug);
};

log {
source(s_src);
filter(f_syslog3);
destination(d_syslog);
};
'''

describe file('/etc/syslog-ng/syslog-ng.conf') do
it { should exist }

# Custom config from pillar
its('content') { should include str }
end
end

+ 7
- 0
test/integration/default/controls/package_spec.rb Zobrazit soubor

control 'SyslogNG package' do
title 'should be installed'

describe package('syslog-ng') do
it { should be_installed }
end
end

+ 16
- 0
test/integration/default/controls/service_spec.rb Zobrazit soubor

syslogng_service =
case platform[:name]
when 'arch'
'syslog-ng@default.service'
else
'syslog-ng'
end
control 'SyslogNG service' do
title 'should be running and enabled'

describe service(syslogng_service) do
it { should be_enabled }
it { should be_running }
end

end

+ 0
- 17
test/integration/default/controls/syslog_ng.rb Zobrazit soubor

# encoding: utf-8

title 'Test SyslogNG installation'

describe package('syslog-ng') do
it { should be_installed }
end

describe file('/etc/syslog-ng/syslog-ng.conf') do
it { should exist }
end

describe sysv_service('syslog-ng') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end

+ 1
- 0
test/integration/default/inspec.yml Zobrazit soubor

- platform-name: suse - platform-name: suse
- platform-name: freebsd - platform-name: freebsd
- platform-name: amazon - platform-name: amazon
- platform-name: arch

+ 33
- 0
test/salt/pillar/syslog_ng.sls Zobrazit soubor

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
syslog_ng:
options:
- chain_hostnames: false
- flush_lines: 0
- use_dns: false
- use_fqdn: false
- owner: root
- group: adm
- perm: =0640
- stats_freq: 0
- bad_hostname: "^gconfd$"

source:
- s_src:
- internal: null

destination:
- d_syslog:
- file:
- /var/log/syslog

filter:
- f_syslog3:
- =not level(debug)

log:
-
- source: =s_src
- filter: =f_syslog3
- destination: =d_syslog

Načítá se…
Zrušit
Uložit