Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Removing custom fact for memory size in bytes #1

Merged
merged 1 commit into from
Feb 27, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Change Log

### upcoming (2014/02/26 19:31 +00:00)
### upcoming (2014/02/26 19:35 +00:00)
- [c8cf711](https://github.com/petems/puppet-swap_file/commit/c8cf711bb10f100c0b9ad66a16e7e54a54f776d3) Initial Commit (@petems)
- [02e1a1a](https://github.com/petems/puppet-swap_file/commit/02e1a1ab01886028bf79e7bc870df110a53cf5b7) Rename spec file (@petems)
- [02e1a1a](https://github.com/petems/puppet-swap_file/commit/02e1a1ab01886028bf79e7bc870df110a53cf5b7) Rename spec file (@petems)
- [fbaa2e4](https://github.com/petems/puppet-swap_file/commit/fbaa2e46f632142f4dc63c4928c8e9e206920a2c) Update changelog with `github-changes` (@petems)
- [3952796](https://github.com/petems/puppet-swap_file/commit/39527966fac72219a1b938af38b8f3a71e3e428e) Removed old CHANGELOG (@petems)
- [43da89d](https://github.com/petems/puppet-swap_file/commit/43da89d4e4d49b4a08c16d6fa2a38774f59910fc) Update module file with details (@petems)
39 changes: 0 additions & 39 deletions lib/facter/meminbytes.rb

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class swap_file (
$ensure = 'present',
$swapfile = '/mnt/swap.1',
$swapfilesize = $::memorysizeinbytes/1000000
$swapfilesize = to_bytes($::memorysize) / 1000000
) inherits swap_file::params {
if $ensure == 'present' {
exec { 'Create swap file':
Expand Down
6 changes: 4 additions & 2 deletions spec/classes/swap_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
describe "swap_file class without any parameters on #{osfamily}" do
let(:params) {{ }}
let(:facts) {{
:osfamily => osfamily, :memorysizeinbytes => 1073741824,
:osfamily => osfamily, :memorysize => '992.65 MB',
}}

it { should compile.with_all_deps }

it { should contain_class('Swap_file::Params') }
it { should contain_class('Swap_file') }

it { should contain_exec('Create swap file') }
it { should contain_exec('Create swap file').
with_command('/bin/dd if=/dev/zero of=/mnt/swap.1 bs=1M count=1040')
}
it { should contain_exec('Attach swap file') }
end
end
Expand Down