aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/nodesets/archlinux-2-x64.yml13
-rw-r--r--spec/acceptance/nodesets/centos-511-x64.yml15
-rw-r--r--spec/acceptance/nodesets/centos-6-x64.yml15
-rw-r--r--spec/acceptance/nodesets/centos-66-x64-pe.yml17
-rw-r--r--spec/acceptance/nodesets/centos-7-x64.yml15
-rw-r--r--spec/acceptance/nodesets/debian-78-x64.yml15
-rw-r--r--spec/acceptance/nodesets/debian-82-x64.yml15
-rw-r--r--spec/acceptance/nodesets/docker/centos-5.yml19
-rw-r--r--spec/acceptance/nodesets/docker/centos-6.yml20
-rw-r--r--spec/acceptance/nodesets/docker/centos-7.yml19
-rw-r--r--spec/acceptance/nodesets/docker/debian-7.yml18
-rw-r--r--spec/acceptance/nodesets/docker/debian-8.yml20
-rw-r--r--spec/acceptance/nodesets/docker/debian-9.yml20
-rw-r--r--spec/acceptance/nodesets/docker/ubuntu-12.04.yml19
-rw-r--r--spec/acceptance/nodesets/docker/ubuntu-14.04.yml21
-rw-r--r--spec/acceptance/nodesets/docker/ubuntu-16.04.yml19
-rw-r--r--spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml31
-rw-r--r--spec/acceptance/nodesets/ec2/image_templates.yaml34
-rw-r--r--spec/acceptance/nodesets/ec2/rhel-73-x64.yml29
-rw-r--r--spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml29
-rw-r--r--spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml29
-rw-r--r--spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml29
-rw-r--r--spec/acceptance/nodesets/fedora-25-x64.yml16
-rw-r--r--spec/acceptance/nodesets/fedora-26-x64.yml16
-rw-r--r--spec/acceptance/nodesets/fedora-27-x64.yml18
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1204-x64.yml15
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1404-x64.yml15
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1604-x64.yml15
-rw-r--r--spec/classes/coverage_spec.rb4
-rw-r--r--spec/classes/ferm_spec.rb58
-rw-r--r--spec/default_facts.yml14
-rw-r--r--spec/defines/chain_spec.rb20
-rw-r--r--spec/defines/rule_spec.rb27
-rw-r--r--spec/spec_helper.rb31
34 files changed, 710 insertions, 0 deletions
diff --git a/spec/acceptance/nodesets/archlinux-2-x64.yml b/spec/acceptance/nodesets/archlinux-2-x64.yml
new file mode 100644
index 0000000..89b6300
--- /dev/null
+++ b/spec/acceptance/nodesets/archlinux-2-x64.yml
@@ -0,0 +1,13 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ archlinux-2-x64:
+ roles:
+ - master
+ platform: archlinux-2-x64
+ box: archlinux/archlinux
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/centos-511-x64.yml b/spec/acceptance/nodesets/centos-511-x64.yml
new file mode 100644
index 0000000..089d646
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-511-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-511-x64:
+ roles:
+ - master
+ platform: el-5-x86_64
+ box: puppetlabs/centos-5.11-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/centos-6-x64.yml b/spec/acceptance/nodesets/centos-6-x64.yml
new file mode 100644
index 0000000..16abc8f
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-6-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-6-x64:
+ roles:
+ - master
+ platform: el-6-x86_64
+ box: centos/6
+ hypervisor: vagrant
+CONFIG:
+ type: aio
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/centos-66-x64-pe.yml b/spec/acceptance/nodesets/centos-66-x64-pe.yml
new file mode 100644
index 0000000..1e7aea6
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-66-x64-pe.yml
@@ -0,0 +1,17 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-66-x64:
+ roles:
+ - master
+ - database
+ - dashboard
+ platform: el-6-x86_64
+ box: puppetlabs/centos-6.6-64-puppet-enterprise
+ hypervisor: vagrant
+CONFIG:
+ type: pe
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/centos-7-x64.yml b/spec/acceptance/nodesets/centos-7-x64.yml
new file mode 100644
index 0000000..e05a3ae
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-7-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-7-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ box: centos/7
+ hypervisor: vagrant
+CONFIG:
+ type: aio
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/debian-78-x64.yml b/spec/acceptance/nodesets/debian-78-x64.yml
new file mode 100644
index 0000000..6ef6de8
--- /dev/null
+++ b/spec/acceptance/nodesets/debian-78-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ debian-78-x64:
+ roles:
+ - master
+ platform: debian-7-amd64
+ box: puppetlabs/debian-7.8-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/debian-82-x64.yml b/spec/acceptance/nodesets/debian-82-x64.yml
new file mode 100644
index 0000000..9897a8f
--- /dev/null
+++ b/spec/acceptance/nodesets/debian-82-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ debian-82-x64:
+ roles:
+ - master
+ platform: debian-8-amd64
+ box: puppetlabs/debian-8.2-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/centos-5.yml b/spec/acceptance/nodesets/docker/centos-5.yml
new file mode 100644
index 0000000..c17bc3d
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/centos-5.yml
@@ -0,0 +1,19 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-5-x64:
+ platform: el-5-x86_64
+ hypervisor: docker
+ image: centos:5
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
+ - 'sed -i -e "/mingetty/d" /etc/inittab'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/centos-6.yml b/spec/acceptance/nodesets/docker/centos-6.yml
new file mode 100644
index 0000000..d93f884
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/centos-6.yml
@@ -0,0 +1,20 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-6-x64:
+ platform: el-6-x86_64
+ hypervisor: docker
+ image: centos:6
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'rm -rf /var/run/network/*'
+ - 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which'
+ - 'rm /etc/init/tty.conf'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/centos-7.yml b/spec/acceptance/nodesets/docker/centos-7.yml
new file mode 100644
index 0000000..41e924b
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/centos-7.yml
@@ -0,0 +1,19 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ centos-7-x64:
+ platform: el-7-x86_64
+ hypervisor: docker
+ image: centos:7
+ docker_preserve_image: true
+ docker_cmd: '["/usr/sbin/init"]'
+ docker_image_commands:
+ - 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which ss'
+ - 'systemctl mask getty@tty1.service'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/debian-7.yml b/spec/acceptance/nodesets/docker/debian-7.yml
new file mode 100644
index 0000000..41b284d
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/debian-7.yml
@@ -0,0 +1,18 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ debian-7-x64:
+ platform: debian-7-amd64
+ hypervisor: docker
+ image: debian:7
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'apt-get update && apt-get install -y cron locales-all net-tools wget'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/debian-8.yml b/spec/acceptance/nodesets/docker/debian-8.yml
new file mode 100644
index 0000000..a630b7e
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/debian-8.yml
@@ -0,0 +1,20 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ debian-8-x64:
+ platform: debian-8-amd64
+ hypervisor: docker
+ image: debian:8
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'apt-get update && apt-get install -y cron locales-all net-tools wget'
+ - 'rm -f /usr/sbin/policy-rc.d'
+ - 'systemctl mask getty@tty1.service getty-static.service'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/debian-9.yml b/spec/acceptance/nodesets/docker/debian-9.yml
new file mode 100644
index 0000000..dfc8e9c
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/debian-9.yml
@@ -0,0 +1,20 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/theforeman/foreman-installer-modulesync
+HOSTS:
+ debian-9-x64:
+ platform: debian-9-amd64
+ hypervisor: docker
+ image: debian:9
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'apt-get update && apt-get install -y cron locales-all net-tools wget systemd-sysv'
+ - 'rm -f /usr/sbin/policy-rc.d'
+ - 'systemctl mask getty@tty1.service getty-static.service'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/ubuntu-12.04.yml b/spec/acceptance/nodesets/docker/ubuntu-12.04.yml
new file mode 100644
index 0000000..ab77cda
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/ubuntu-12.04.yml
@@ -0,0 +1,19 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-1204-x64:
+ platform: ubuntu-12.04-amd64
+ hypervisor: docker
+ image: ubuntu:12.04
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'apt-get install -y net-tools wget'
+ - 'locale-gen en_US.UTF-8'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/ubuntu-14.04.yml b/spec/acceptance/nodesets/docker/ubuntu-14.04.yml
new file mode 100644
index 0000000..ae45304
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/ubuntu-14.04.yml
@@ -0,0 +1,21 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-1404-x64:
+ platform: ubuntu-14.04-amd64
+ hypervisor: docker
+ image: ubuntu:14.04
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'rm /usr/sbin/policy-rc.d'
+ - 'rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl'
+ - 'apt-get install -y net-tools wget apt-transport-https'
+ - 'locale-gen en_US.UTF-8'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/docker/ubuntu-16.04.yml b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml
new file mode 100644
index 0000000..2d173c5
--- /dev/null
+++ b/spec/acceptance/nodesets/docker/ubuntu-16.04.yml
@@ -0,0 +1,19 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-1604-x64:
+ platform: ubuntu-16.04-amd64
+ hypervisor: docker
+ image: ubuntu:16.04
+ docker_preserve_image: true
+ docker_cmd: '["/sbin/init"]'
+ docker_image_commands:
+ - 'apt-get install -y net-tools wget locales apt-transport-https'
+ - 'locale-gen en_US.UTF-8'
+CONFIG:
+ trace_limit: 200
+ masterless: true
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml b/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml
new file mode 100644
index 0000000..19dd43e
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml
@@ -0,0 +1,31 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# Additional ~/.fog config file with AWS EC2 credentials
+# required.
+#
+# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+# Amazon Linux is not a RHEL clone.
+#
+HOSTS:
+ amazonlinux-2016091-x64:
+ roles:
+ - master
+ platform: centos-6-x86_64
+ hypervisor: ec2
+ # refers to image_tempaltes.yaml AMI[vmname] entry:
+ vmname: amazonlinux-2016091-eu-central-1
+ # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
+ snapshot: aio
+ # t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
+ amisize: t2.micro
+ # required so that beaker sanitizes sshd_config and root authorized_keys:
+ user: ec2-user
+CONFIG:
+ type: aio
+ :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ec2/image_templates.yaml b/spec/acceptance/nodesets/ec2/image_templates.yaml
new file mode 100644
index 0000000..e50593e
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/image_templates.yaml
@@ -0,0 +1,34 @@
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# see also: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+# Hint: image IDs (ami-*) for the same image are different per location.
+#
+AMI:
+ # Amazon Linux AMI 2016.09.1 (HVM), SSD Volume Type
+ amazonlinux-2016091-eu-central-1:
+ :image:
+ :aio: ami-af0fc0c0
+ :region: eu-central-1
+ # Red Hat Enterprise Linux 7.3 (HVM), SSD Volume Type
+ rhel-73-eu-central-1:
+ :image:
+ :aio: ami-e4c63e8b
+ :region: eu-central-1
+ # SUSE Linux Enterprise Server 12 SP2 (HVM), SSD Volume Type
+ sles-12sp2-eu-central-1:
+ :image:
+ :aio: ami-c425e4ab
+ :region: eu-central-1
+ # Ubuntu Server 16.04 LTS (HVM), SSD Volume Type
+ ubuntu-1604-eu-central-1:
+ :image:
+ :aio: ami-fe408091
+ :region: eu-central-1
+ # Microsoft Windows Server 2016 Base
+ windows-2016-base-eu-central-1:
+ :image:
+ :aio: ami-88ec20e7
+ :region: eu-central-1
diff --git a/spec/acceptance/nodesets/ec2/rhel-73-x64.yml b/spec/acceptance/nodesets/ec2/rhel-73-x64.yml
new file mode 100644
index 0000000..7fac823
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/rhel-73-x64.yml
@@ -0,0 +1,29 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# Additional ~/.fog config file with AWS EC2 credentials
+# required.
+#
+# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+HOSTS:
+ rhel-73-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ hypervisor: ec2
+ # refers to image_tempaltes.yaml AMI[vmname] entry:
+ vmname: rhel-73-eu-central-1
+ # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
+ snapshot: aio
+ # t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
+ amisize: t2.micro
+ # required so that beaker sanitizes sshd_config and root authorized_keys:
+ user: ec2-user
+CONFIG:
+ type: aio
+ :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml b/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml
new file mode 100644
index 0000000..8542154
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml
@@ -0,0 +1,29 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# Additional ~/.fog config file with AWS EC2 credentials
+# required.
+#
+# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+HOSTS:
+ sles-12sp2-x64:
+ roles:
+ - master
+ platform: sles-12-x86_64
+ hypervisor: ec2
+ # refers to image_tempaltes.yaml AMI[vmname] entry:
+ vmname: sles-12sp2-eu-central-1
+ # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
+ snapshot: aio
+ # t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
+ amisize: t2.micro
+ # required so that beaker sanitizes sshd_config and root authorized_keys:
+ user: ec2-user
+CONFIG:
+ type: aio
+ :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml b/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml
new file mode 100644
index 0000000..9cf59d5
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml
@@ -0,0 +1,29 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# Additional ~/.fog config file with AWS EC2 credentials
+# required.
+#
+# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+HOSTS:
+ ubuntu-1604-x64:
+ roles:
+ - master
+ platform: ubuntu-16.04-amd64
+ hypervisor: ec2
+ # refers to image_tempaltes.yaml AMI[vmname] entry:
+ vmname: ubuntu-1604-eu-central-1
+ # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
+ snapshot: aio
+ # t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
+ amisize: t2.micro
+ # required so that beaker sanitizes sshd_config and root authorized_keys:
+ user: ubuntu
+CONFIG:
+ type: aio
+ :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml b/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml
new file mode 100644
index 0000000..0932e29
--- /dev/null
+++ b/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml
@@ -0,0 +1,29 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# Additional ~/.fog config file with AWS EC2 credentials
+# required.
+#
+# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
+#
+HOSTS:
+ windows-2016-base-x64:
+ roles:
+ - master
+ platform: windows-2016-64
+ hypervisor: ec2
+ # refers to image_tempaltes.yaml AMI[vmname] entry:
+ vmname: windows-2016-base-eu-central-1
+ # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
+ snapshot: aio
+ # t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
+ amisize: t2.micro
+ # required so that beaker sanitizes sshd_config and root authorized_keys:
+ user: ec2-user
+CONFIG:
+ type: aio
+ :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/fedora-25-x64.yml b/spec/acceptance/nodesets/fedora-25-x64.yml
new file mode 100644
index 0000000..54dd330
--- /dev/null
+++ b/spec/acceptance/nodesets/fedora-25-x64.yml
@@ -0,0 +1,16 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+HOSTS:
+ fedora-25-x64:
+ roles:
+ - master
+ platform: fedora-25-x86_64
+ box: fedora/25-cloud-base
+ hypervisor: vagrant
+CONFIG:
+ type: aio
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/fedora-26-x64.yml b/spec/acceptance/nodesets/fedora-26-x64.yml
new file mode 100644
index 0000000..598822b
--- /dev/null
+++ b/spec/acceptance/nodesets/fedora-26-x64.yml
@@ -0,0 +1,16 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+HOSTS:
+ fedora-26-x64:
+ roles:
+ - master
+ platform: fedora-26-x86_64
+ box: fedora/26-cloud-base
+ hypervisor: vagrant
+CONFIG:
+ type: aio
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/fedora-27-x64.yml b/spec/acceptance/nodesets/fedora-27-x64.yml
new file mode 100644
index 0000000..c2b61eb
--- /dev/null
+++ b/spec/acceptance/nodesets/fedora-27-x64.yml
@@ -0,0 +1,18 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# platform is fedora 26 because there is no puppet-agent
+# for fedora 27 as of 2017-11-17
+HOSTS:
+ fedora-27-x64:
+ roles:
+ - master
+ platform: fedora-26-x86_64
+ box: fedora/27-cloud-base
+ hypervisor: vagrant
+CONFIG:
+ type: aio
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
new file mode 100644
index 0000000..29102c5
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-server-1204-x64:
+ roles:
+ - master
+ platform: ubuntu-12.04-amd64
+ box: puppetlabs/ubuntu-12.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
new file mode 100644
index 0000000..054e658
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-server-1404-x64:
+ roles:
+ - master
+ platform: ubuntu-14.04-amd64
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
new file mode 100644
index 0000000..bc85e0e
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1604-x64.yml
@@ -0,0 +1,15 @@
+---
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+HOSTS:
+ ubuntu-server-1604-x64:
+ roles:
+ - master
+ platform: ubuntu-16.04-amd64
+ box: puppetlabs/ubuntu-16.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
+...
+# vim: syntax=yaml
diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb
new file mode 100644
index 0000000..de44654
--- /dev/null
+++ b/spec/classes/coverage_spec.rb
@@ -0,0 +1,4 @@
+require 'rspec-puppet'
+
+at_exit { RSpec::Puppet::Coverage.report! }
+# vim: syntax=ruby
diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb
new file mode 100644
index 0000000..e039c14
--- /dev/null
+++ b/spec/classes/ferm_spec.rb
@@ -0,0 +1,58 @@
+require 'spec_helper'
+
+describe 'ferm' do
+ let :node do
+ 'example.com'
+ end
+
+ on_supported_os.each do |os, facts|
+ context "on #{os} " do
+ let :facts do
+ facts
+ end
+
+ context 'with all defaults' do
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_class('ferm::config') }
+ it { is_expected.to contain_class('ferm::service') }
+ it { is_expected.to contain_class('ferm::install') }
+ it { is_expected.to contain_package('ferm') }
+ it { is_expected.to contain_file('/etc/ferm.d') }
+ it { is_expected.to contain_file('/etc/ferm.d/definitions') }
+ it { is_expected.to contain_file('/etc/ferm.d/chains') }
+ it { is_expected.not_to contain_service('ferm') }
+ it { is_expected.not_to contain_file('/etc/ferm.conf') }
+ end
+
+ context 'with managed service' do
+ let :params do
+ { manage_service: true }
+ end
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_service('ferm') }
+ end
+ context 'with managed configfile' do
+ let :params do
+ { manage_configfile: true }
+ end
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_concat('/etc/ferm.conf') }
+ it { is_expected.to contain_concat__fragment('ferm_header.conf') }
+ it { is_expected.to contain_concat__fragment('ferm.conf') }
+ end
+ context 'it creates chains' do
+ it { is_expected.to contain_concat__fragment('FORWARD-policy') }
+ it { is_expected.to contain_concat__fragment('INPUT-policy') }
+ it { is_expected.to contain_concat__fragment('OUTPUT-policy') }
+ it { is_expected.to contain_concat('/etc/ferm.d/chains/FORWARD.conf') }
+ it { is_expected.to contain_concat('/etc/ferm.d/chains/INPUT.conf') }
+ it { is_expected.to contain_concat('/etc/ferm.d/chains/OUTPUT.conf') }
+ it { is_expected.to contain_ferm__chain('FORWARD') }
+ it { is_expected.to contain_ferm__chain('OUTPUT') }
+ it { is_expected.to contain_ferm__chain('INPUT') }
+ end
+ end
+ end
+end
diff --git a/spec/default_facts.yml b/spec/default_facts.yml
new file mode 100644
index 0000000..13c4165
--- /dev/null
+++ b/spec/default_facts.yml
@@ -0,0 +1,14 @@
+# This file is managed via modulesync
+# https://github.com/voxpupuli/modulesync
+# https://github.com/voxpupuli/modulesync_config
+#
+# use default_module_facts.yaml for module specific
+# facts.
+#
+# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
+# if a same named fact exists in facterdb it will be overridden.
+---
+concat_basedir: "/tmp"
+ipaddress: "172.16.254.254"
+is_pe: false
+macaddress: "AA:AA:AA:AA:AA:AA"
diff --git a/spec/defines/chain_spec.rb b/spec/defines/chain_spec.rb
new file mode 100644
index 0000000..110f1d0
--- /dev/null
+++ b/spec/defines/chain_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe 'ferm::chain', type: :define do
+ on_supported_os.each do |os, facts|
+ context "on #{os} " do
+ let :facts do
+ facts
+ end
+ let(:title) { 'INPUT' }
+ let(:params) { { policy: 'DROP' } }
+
+ context 'default params creates INPUT chain' do
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_concat__fragment('INPUT-policy') }
+ it { is_expected.to contain_concat('/etc/ferm.d/chains/INPUT.conf') }
+ it { is_expected.to contain_ferm__chain('INPUT') }
+ end
+ end
+ end
+end
diff --git a/spec/defines/rule_spec.rb b/spec/defines/rule_spec.rb
new file mode 100644
index 0000000..0926432
--- /dev/null
+++ b/spec/defines/rule_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe 'ferm::rule', type: :define do
+ on_supported_os.each do |os, facts|
+ context "on #{os} " do
+ let :facts do
+ facts
+ end
+ let(:title) { 'filter-ssh' }
+ let :params do
+ {
+ chain: 'INPUT',
+ policy: 'ACCEPT',
+ proto: 'tcp',
+ dport: '22',
+ saddr: '127.0.0.1'
+ }
+ end
+
+ context 'default params create simple rule' do
+ it { is_expected.to compile.with_all_deps }
+ # it { is_expected.to contain_concat__fragment('INPUT-filter-ssh').with_content("proto tcp dport ssh saddr @ipfilter(127.0.0.1) ACCEPT;") }
+ it { is_expected.to contain_concat__fragment('INPUT-filter-ssh') }
+ end
+ end
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..cdd4935
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,31 @@
+require 'puppetlabs_spec_helper/module_spec_helper'
+require 'rspec-puppet-facts'
+include RspecPuppetFacts
+
+if Dir.exist?(File.expand_path('../../lib', __FILE__))
+ require 'coveralls'
+ require 'simplecov'
+ require 'simplecov-console'
+ SimpleCov.formatters = [
+ SimpleCov::Formatter::HTMLFormatter,
+ SimpleCov::Formatter::Console
+ ]
+ SimpleCov.start do
+ track_files 'lib/**/*.rb'
+ add_filter '/spec'
+ add_filter '/vendor'
+ add_filter '/.vendor'
+ end
+end
+
+RSpec.configure do |c|
+ default_facts = {
+ puppetversion: Puppet.version,
+ facterversion: Facter.version
+ }
+ default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
+ default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__))
+ c.default_facts = default_facts
+end
+
+# vim: syntax=ruby