mirror of
https://github.com/ardichoke/puppet-arpwatch.git
synced 2026-05-11 02:15:37 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d79f35a823 | |||
| 2abd0ae6c4 | |||
| 341b0cecee |
5
.fixtures.yml
Normal file
5
.fixtures.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fixtures:
|
||||||
|
repositories:
|
||||||
|
stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git
|
||||||
|
symlinks:
|
||||||
|
arpwatch: "#{source_dir}"
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pkg/
|
||||||
@@ -23,7 +23,7 @@ Install and configure arpwatch
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
All interaction with the arpwatch module is done through the main arpwatch class. You can simply set the options in `::ntp` to have full functionality of the module.
|
All interaction with the arpwatch module is done through the main arpwatch class. You can simply set the options in `::arpwatch` to have full functionality of the module.
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class arpwatch::params {
|
|||||||
$interface = 'eth0'
|
$interface = 'eth0'
|
||||||
$config_file = '/etc/sysconfig/arpwatch'
|
$config_file = '/etc/sysconfig/arpwatch'
|
||||||
$config_template = 'arpwatch/conf.rhel.erb'
|
$config_template = 'arpwatch/conf.rhel.erb'
|
||||||
$service_user = $::os_maj_version ? {
|
$service_user = $::operatingsystemmajrelease ? {
|
||||||
'5' => 'pcap',
|
'5' => 'pcap',
|
||||||
default => 'arpwatch',
|
default => 'arpwatch',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ardichoke-arpwatch",
|
"name": "ardichoke-arpwatch",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"author": "ardichoke",
|
"author": "ardichoke",
|
||||||
"summary": "Install and manage arpwatch",
|
"summary": "Install and manage arpwatch",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -16,8 +16,9 @@
|
|||||||
"7"
|
"7"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
"dependencies": [],
|
"dependencies": [
|
||||||
|
{ "name": "puppetlabs/stdlib", "version_requirement": ">=1.0.0 <5.0.0"},
|
||||||
|
],
|
||||||
"tags": ["arpwatch","network","monitoring"]
|
"tags": ["arpwatch","network","monitoring"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
spec/classes/init_spec.rb
Normal file
34
spec/classes/init_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
describe 'arpwatch', type: 'class' do
|
||||||
|
context 'On RedHat 7 with no parameters' do
|
||||||
|
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '7' } }
|
||||||
|
it {
|
||||||
|
should contain_package('arpwatch').with({'ensure'=>'installed'})
|
||||||
|
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
|
||||||
|
}
|
||||||
|
end
|
||||||
|
context 'On RedHat 6 with no parameters' do
|
||||||
|
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
|
||||||
|
it {
|
||||||
|
should contain_package('arpwatch').with({'ensure'=>'installed'})
|
||||||
|
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
|
||||||
|
}
|
||||||
|
end
|
||||||
|
context 'On RedHat 5 with no parameters' do
|
||||||
|
let (:facts) { { osfamily: 'RedHat', operatingsystemmajrelease: '6' } }
|
||||||
|
it {
|
||||||
|
should contain_package('arpwatch').with({'ensure'=>'installed'})
|
||||||
|
should contain_file('/etc/sysconfig/arpwatch').with({'ensure'=>'file'})
|
||||||
|
}
|
||||||
|
end
|
||||||
|
context 'On an unknown OS' do
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:osfamily => 'Darwin'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it {
|
||||||
|
expect { should raise_error(Puppet::Error) }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
6
spec/spec_helper.rb
Normal file
6
spec/spec_helper.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require 'rspec-puppet'
|
||||||
|
fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
|
||||||
|
RSpec.configure do |c|
|
||||||
|
c.module_path = File.join(fixture_path, 'modules')
|
||||||
|
c.manifest_dir = File.join(fixture_path, 'manifests')
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user